emdash 1.0.1 → 1.1.0

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 (1267) hide show
  1. package/dist/action-token-AgOs1UWD.mjs +26 -0
  2. package/dist/action-token-AgOs1UWD.mjs.map +1 -0
  3. package/dist/activation-xomsCMJg.mjs +387 -0
  4. package/dist/activation-xomsCMJg.mjs.map +1 -0
  5. package/dist/adapters-DM1oyHIN.d.mts +173 -0
  6. package/dist/adapters-DM1oyHIN.d.mts.map +1 -0
  7. package/dist/allowed-origins-CFtudhyw.mjs +116 -0
  8. package/dist/allowed-origins-CFtudhyw.mjs.map +1 -0
  9. package/dist/api/route-utils.d.mts +4 -4
  10. package/dist/api/route-utils.mjs +48 -47
  11. package/dist/api/route-utils.mjs.map +1 -1
  12. package/dist/api/schemas/index.d.mts +2 -2
  13. package/dist/api/schemas/index.mjs +10 -10
  14. package/dist/api-CltsXhiX.mjs +4980 -0
  15. package/dist/api-CltsXhiX.mjs.map +1 -0
  16. package/dist/api-tokens-P3mAaQgr.mjs +166 -0
  17. package/dist/api-tokens-P3mAaQgr.mjs.map +1 -0
  18. package/dist/apply-Q7uvzBWW.mjs +1680 -0
  19. package/dist/apply-Q7uvzBWW.mjs.map +1 -0
  20. package/dist/approvals-DycwI6lZ.mjs +460 -0
  21. package/dist/approvals-DycwI6lZ.mjs.map +1 -0
  22. package/dist/artifact-fetch-CWxyELVI.mjs +659 -0
  23. package/dist/artifact-fetch-CWxyELVI.mjs.map +1 -0
  24. package/dist/artifacts-UzWbysb8.mjs +307 -0
  25. package/dist/artifacts-UzWbysb8.mjs.map +1 -0
  26. package/dist/astro/index.d.mts +14 -14
  27. package/dist/astro/index.d.mts.map +1 -1
  28. package/dist/astro/index.mjs +38 -12
  29. package/dist/astro/index.mjs.map +1 -1
  30. package/dist/astro/middleware/auth.d.mts +12 -12
  31. package/dist/astro/middleware/auth.mjs +12 -11
  32. package/dist/astro/middleware/auth.mjs.map +1 -1
  33. package/dist/astro/middleware/media-usage-write-fence.mjs +6 -6
  34. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  35. package/dist/astro/middleware/redirect.mjs +9 -22
  36. package/dist/astro/middleware/redirect.mjs.map +1 -1
  37. package/dist/astro/middleware/request-context.d.mts.map +1 -1
  38. package/dist/astro/middleware/request-context.mjs +33 -21
  39. package/dist/astro/middleware/request-context.mjs.map +1 -1
  40. package/dist/astro/middleware/setup.mjs +1 -1
  41. package/dist/astro/middleware.d.mts +12 -12
  42. package/dist/astro/middleware.d.mts.map +1 -1
  43. package/dist/astro/middleware.mjs +203 -120
  44. package/dist/astro/middleware.mjs.map +1 -1
  45. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +15 -15
  46. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +15 -15
  47. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +7 -7
  48. package/dist/astro/routes/api/admin/api-tokens/index.mjs +8 -8
  49. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +7 -7
  50. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +17 -17
  51. package/dist/astro/routes/api/admin/byline-fields/index.mjs +17 -17
  52. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +17 -17
  53. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +22 -22
  54. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +22 -23
  55. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
  56. package/dist/astro/routes/api/admin/bylines/index.mjs +23 -23
  57. package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
  58. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +19 -19
  59. package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
  60. package/dist/astro/routes/api/admin/comments/bulk.mjs +18 -18
  61. package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
  62. package/dist/astro/routes/api/admin/comments/index.mjs +18 -18
  63. package/dist/astro/routes/api/admin/core-update.mjs +8 -8
  64. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +7 -7
  65. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +6 -6
  66. package/dist/astro/routes/api/admin/media-usage/activation.mjs +21 -21
  67. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +22 -22
  68. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +22 -22
  69. package/dist/astro/routes/api/admin/media-usage/progress.mjs +23 -23
  70. package/dist/astro/routes/api/admin/media-usage/repair.mjs +29 -29
  71. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +22 -22
  72. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +22 -22
  73. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +7 -7
  74. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +7 -7
  75. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +9 -9
  76. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +9 -9
  77. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +72 -71
  78. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  79. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +8 -8
  80. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +70 -69
  81. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  82. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +71 -70
  83. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  84. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +81 -80
  85. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/plugins/index.mjs +71 -70
  87. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +8 -8
  89. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +70 -69
  90. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  91. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +80 -79
  92. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  93. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +70 -69
  94. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  95. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +71 -70
  96. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  97. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +82 -81
  98. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  99. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +10 -10
  100. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +73 -72
  101. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  102. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +8 -8
  103. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +71 -70
  104. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
  105. package/dist/astro/routes/api/admin/plugins/updates.mjs +70 -69
  106. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  107. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +6 -6
  108. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +70 -69
  109. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  110. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +8 -8
  111. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +70 -69
  112. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  113. package/dist/astro/routes/api/admin/transfer/_...path_.mjs +5 -5
  114. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +39 -39
  115. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +39 -39
  116. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +41 -41
  117. package/dist/astro/routes/api/admin/transfer/capabilities.mjs +41 -41
  118. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +41 -41
  119. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +42 -42
  120. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +42 -42
  121. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +41 -41
  122. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +42 -42
  123. package/dist/astro/routes/api/admin/transfer/exports/index.mjs +43 -43
  124. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +41 -41
  125. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +41 -41
  126. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +43 -43
  127. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +41 -41
  128. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +43 -43
  129. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +41 -41
  130. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +41 -41
  131. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +43 -43
  132. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +41 -41
  133. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +41 -41
  134. package/dist/astro/routes/api/admin/transfer/imports/index.mjs +43 -43
  135. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +5 -5
  136. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +5 -5
  137. package/dist/astro/routes/api/admin/users/_id_/index.mjs +15 -15
  138. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +7 -7
  139. package/dist/astro/routes/api/admin/users/index.mjs +15 -15
  140. package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -7
  141. package/dist/astro/routes/api/auth/invite/accept.mjs +5 -5
  142. package/dist/astro/routes/api/auth/invite/complete.mjs +20 -20
  143. package/dist/astro/routes/api/auth/invite/index.mjs +17 -17
  144. package/dist/astro/routes/api/auth/invite/register-options.mjs +18 -18
  145. package/dist/astro/routes/api/auth/logout.mjs +6 -6
  146. package/dist/astro/routes/api/auth/magic-link/send.mjs +19 -19
  147. package/dist/astro/routes/api/auth/magic-link/verify.mjs +16 -16
  148. package/dist/astro/routes/api/auth/me.mjs +16 -16
  149. package/dist/astro/routes/api/auth/mode.mjs +6 -6
  150. package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -1
  151. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +36 -13
  152. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
  153. package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -1
  154. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +20 -5
  155. package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
  156. package/dist/astro/routes/api/auth/passkey/_id_.mjs +15 -15
  157. package/dist/astro/routes/api/auth/passkey/index.mjs +5 -5
  158. package/dist/astro/routes/api/auth/passkey/options.mjs +20 -20
  159. package/dist/astro/routes/api/auth/passkey/register/options.mjs +18 -18
  160. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +19 -19
  161. package/dist/astro/routes/api/auth/passkey/verify.mjs +20 -20
  162. package/dist/astro/routes/api/auth/signup/complete.mjs +20 -20
  163. package/dist/astro/routes/api/auth/signup/request.mjs +18 -18
  164. package/dist/astro/routes/api/auth/signup/verify.mjs +5 -5
  165. package/dist/astro/routes/api/calendar.d.mts +8 -0
  166. package/dist/astro/routes/api/calendar.d.mts.map +1 -0
  167. package/dist/astro/routes/api/calendar.mjs +204 -0
  168. package/dist/astro/routes/api/calendar.mjs.map +1 -0
  169. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -14
  170. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +20 -20
  171. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +6 -6
  172. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +17 -17
  173. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -6
  174. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +17 -17
  175. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -6
  176. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +12 -12
  177. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +31 -31
  178. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +17 -17
  179. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +34 -34
  180. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +34 -34
  181. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -6
  182. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +6 -6
  183. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +17 -17
  184. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +24 -24
  185. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +6 -6
  186. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +17 -17
  187. package/dist/astro/routes/api/content/_collection_/_id_.mjs +17 -17
  188. package/dist/astro/routes/api/content/_collection_/authors.mjs +6 -6
  189. package/dist/astro/routes/api/content/_collection_/index.mjs +16 -16
  190. package/dist/astro/routes/api/content/_collection_/trash.mjs +16 -16
  191. package/dist/astro/routes/api/dashboard.mjs +11 -11
  192. package/dist/astro/routes/api/dev/emails.mjs +6 -6
  193. package/dist/astro/routes/api/health.mjs +7 -7
  194. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  195. package/dist/astro/routes/api/import/probe.mjs +24 -24
  196. package/dist/astro/routes/api/import/wordpress/analyze.mjs +6 -6
  197. package/dist/astro/routes/api/import/wordpress/execute.d.mts +13 -13
  198. package/dist/astro/routes/api/import/wordpress/execute.mjs +23 -23
  199. package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -12
  200. package/dist/astro/routes/api/import/wordpress/media.mjs +20 -20
  201. package/dist/astro/routes/api/import/wordpress/prepare.mjs +18 -18
  202. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +13 -13
  203. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +27 -27
  204. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  205. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -24
  206. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  207. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +13 -13
  208. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +32 -32
  209. package/dist/astro/routes/api/manifest.mjs +7 -7
  210. package/dist/astro/routes/api/mcp.mjs +94 -94
  211. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  212. package/dist/astro/routes/api/media/_id_/confirm.mjs +19 -19
  213. package/dist/astro/routes/api/media/_id_/replace.mjs +17 -17
  214. package/dist/astro/routes/api/media/_id_/upload.mjs +10 -10
  215. package/dist/astro/routes/api/media/_id_/usage.mjs +31 -31
  216. package/dist/astro/routes/api/media/_id_.mjs +29 -29
  217. package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +7 -7
  218. package/dist/astro/routes/api/media/file/_...key_.mjs +10 -10
  219. package/dist/astro/routes/api/media/folders/_id_.mjs +17 -17
  220. package/dist/astro/routes/api/media/folders/index.mjs +17 -17
  221. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +6 -6
  222. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +6 -6
  223. package/dist/astro/routes/api/media/providers/index.mjs +6 -6
  224. package/dist/astro/routes/api/media/upload-url.mjs +23 -23
  225. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  226. package/dist/astro/routes/api/media.mjs +37 -36
  227. package/dist/astro/routes/api/media.mjs.map +1 -1
  228. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +18 -18
  229. package/dist/astro/routes/api/menus/_name_/items.mjs +18 -18
  230. package/dist/astro/routes/api/menus/_name_/reorder.mjs +18 -18
  231. package/dist/astro/routes/api/menus/_name_/translations.mjs +18 -18
  232. package/dist/astro/routes/api/menus/_name_.mjs +18 -18
  233. package/dist/astro/routes/api/menus/index.mjs +18 -18
  234. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  235. package/dist/astro/routes/api/oauth/device/authorize.mjs +9 -9
  236. package/dist/astro/routes/api/oauth/device/code.mjs +12 -12
  237. package/dist/astro/routes/api/oauth/device/token.mjs +11 -11
  238. package/dist/astro/routes/api/oauth/register.mjs +8 -8
  239. package/dist/astro/routes/api/oauth/token/refresh.mjs +9 -9
  240. package/dist/astro/routes/api/oauth/token/revoke.mjs +9 -9
  241. package/dist/astro/routes/api/oauth/token.mjs +9 -9
  242. package/dist/astro/routes/api/openapi.json.mjs +21 -21
  243. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +12 -12
  244. package/dist/astro/routes/api/redirects/404s/index.mjs +20 -19
  245. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  246. package/dist/astro/routes/api/redirects/404s/summary.mjs +20 -19
  247. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  248. package/dist/astro/routes/api/redirects/_id_.mjs +20 -19
  249. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  250. package/dist/astro/routes/api/redirects/index.mjs +20 -19
  251. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  252. package/dist/astro/routes/api/relations/_id_/index.mjs +34 -34
  253. package/dist/astro/routes/api/relations/index.mjs +34 -34
  254. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +6 -6
  255. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +17 -17
  256. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +70 -69
  257. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -1
  258. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +70 -69
  259. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -1
  260. package/dist/astro/routes/api/schema/block-types/index.mjs +70 -69
  261. package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
  262. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +70 -69
  263. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  264. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +70 -69
  265. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  266. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +70 -69
  267. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  268. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +70 -69
  269. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  270. package/dist/astro/routes/api/schema/collections/index.mjs +70 -69
  271. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  272. package/dist/astro/routes/api/schema/collections/reorder.mjs +70 -69
  273. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
  274. package/dist/astro/routes/api/schema/index.mjs +16 -16
  275. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +70 -69
  276. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  277. package/dist/astro/routes/api/schema/orphans/index.mjs +70 -69
  278. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  279. package/dist/astro/routes/api/search/enable.mjs +19 -19
  280. package/dist/astro/routes/api/search/index.mjs +18 -18
  281. package/dist/astro/routes/api/search/rebuild.mjs +19 -19
  282. package/dist/astro/routes/api/search/stats.mjs +9 -9
  283. package/dist/astro/routes/api/search/suggest.mjs +18 -18
  284. package/dist/astro/routes/api/sections/_slug_.mjs +18 -18
  285. package/dist/astro/routes/api/sections/index.mjs +18 -18
  286. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -8
  287. package/dist/astro/routes/api/settings/backups/archives/index.mjs +8 -8
  288. package/dist/astro/routes/api/settings/backups/export.mjs +8 -8
  289. package/dist/astro/routes/api/settings/backups/index.mjs +9 -9
  290. package/dist/astro/routes/api/settings/email.mjs +7 -7
  291. package/dist/astro/routes/api/settings.mjs +22 -22
  292. package/dist/astro/routes/api/setup/admin-verify.mjs +21 -21
  293. package/dist/astro/routes/api/setup/admin.mjs +19 -19
  294. package/dist/astro/routes/api/setup/dev-bypass.mjs +42 -42
  295. package/dist/astro/routes/api/setup/dev-reset.mjs +5 -5
  296. package/dist/astro/routes/api/setup/index.mjs +54 -49
  297. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  298. package/dist/astro/routes/api/setup/status.mjs +7 -7
  299. package/dist/astro/routes/api/snapshot.mjs +10 -10
  300. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +22 -22
  301. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +22 -22
  302. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +22 -22
  303. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +22 -22
  304. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +21 -21
  305. package/dist/astro/routes/api/taxonomies/_name_.mjs +22 -22
  306. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +35 -35
  307. package/dist/astro/routes/api/taxonomies/index.mjs +22 -22
  308. package/dist/astro/routes/api/themes/preview.mjs +8 -8
  309. package/dist/astro/routes/api/typegen.mjs +7 -7
  310. package/dist/astro/routes/api/visual-editing/action-token.mjs +8 -8
  311. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +20 -20
  312. package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +5 -5
  313. package/dist/astro/routes/api/well-known/auth.mjs +1 -1
  314. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  315. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  316. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +17 -17
  317. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +19 -19
  318. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +19 -19
  319. package/dist/astro/routes/api/widget-areas/_name_.mjs +9 -9
  320. package/dist/astro/routes/api/widget-areas/index.mjs +19 -19
  321. package/dist/astro/routes/api/widget-components.mjs +6 -6
  322. package/dist/astro/routes/robots.txt.mjs +7 -7
  323. package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
  324. package/dist/astro/routes/sitemap.xml.mjs +8 -8
  325. package/dist/astro/types.d.mts +17 -17
  326. package/dist/audit-CCH3MA4Y.mjs +127 -0
  327. package/dist/audit-CCH3MA4Y.mjs.map +1 -0
  328. package/dist/auth/providers/github.d.mts +1 -1
  329. package/dist/auth/providers/google.d.mts +1 -1
  330. package/dist/auth/providers/microsoft.d.mts +27 -0
  331. package/dist/auth/providers/microsoft.d.mts.map +1 -0
  332. package/dist/auth/providers/microsoft.mjs +20 -0
  333. package/dist/auth/providers/microsoft.mjs.map +1 -0
  334. package/dist/authoritative-records-dSvXCfzb.mjs +5172 -0
  335. package/dist/authoritative-records-dSvXCfzb.mjs.map +1 -0
  336. package/dist/authorize-DeWfk--K.mjs +49 -0
  337. package/dist/authorize-DeWfk--K.mjs.map +1 -0
  338. package/dist/backup-CFnbdTSJ.mjs +246 -0
  339. package/dist/backup-CFnbdTSJ.mjs.map +1 -0
  340. package/dist/base64-BQBZwXCx.mjs +63 -0
  341. package/dist/base64-BQBZwXCx.mjs.map +1 -0
  342. package/dist/block-types-C0YFSfR7.mjs +132 -0
  343. package/dist/block-types-C0YFSfR7.mjs.map +1 -0
  344. package/dist/block-values-H4E0XwE8.mjs +175 -0
  345. package/dist/block-values-H4E0XwE8.mjs.map +1 -0
  346. package/dist/byline-BhVslYLz.mjs +909 -0
  347. package/dist/byline-BhVslYLz.mjs.map +1 -0
  348. package/dist/byline-fields-DHJs0Mja.mjs +280 -0
  349. package/dist/byline-fields-DHJs0Mja.mjs.map +1 -0
  350. package/dist/byline-fields-xdxE9kxZ.mjs +123 -0
  351. package/dist/byline-fields-xdxE9kxZ.mjs.map +1 -0
  352. package/dist/bylines-B_nN9liM.mjs +234 -0
  353. package/dist/bylines-B_nN9liM.mjs.map +1 -0
  354. package/dist/bylines-C71YACkL.mjs +150 -0
  355. package/dist/bylines-C71YACkL.mjs.map +1 -0
  356. package/dist/cache-aTYCL9nK.mjs +133 -0
  357. package/dist/cache-aTYCL9nK.mjs.map +1 -0
  358. package/dist/canonical-Y1dpjCnp.mjs +174 -0
  359. package/dist/canonical-Y1dpjCnp.mjs.map +1 -0
  360. package/dist/capture-triggers-C9JKoIdT.mjs +362 -0
  361. package/dist/capture-triggers-C9JKoIdT.mjs.map +1 -0
  362. package/dist/challenge-store-CxZxPqaw.mjs +51 -0
  363. package/dist/challenge-store-CxZxPqaw.mjs.map +1 -0
  364. package/dist/checksum-DtH6m5uk.mjs +162 -0
  365. package/dist/checksum-DtH6m5uk.mjs.map +1 -0
  366. package/dist/chrome-tags-BIKBMZYO.mjs +24 -0
  367. package/dist/chrome-tags-BIKBMZYO.mjs.map +1 -0
  368. package/dist/chunks-zlGB5IQP.mjs +25 -0
  369. package/dist/chunks-zlGB5IQP.mjs.map +1 -0
  370. package/dist/cli/index.mjs +47 -47
  371. package/dist/client/cf-access.d.mts +1 -1
  372. package/dist/client/index.d.mts +121 -121
  373. package/dist/client/index.mjs +2 -2
  374. package/dist/collection-slugs-cache-B2Gs9Jwx.mjs +85 -0
  375. package/dist/collection-slugs-cache-B2Gs9Jwx.mjs.map +1 -0
  376. package/dist/comment-Bu08Wvr3.mjs +313 -0
  377. package/dist/comment-Bu08Wvr3.mjs.map +1 -0
  378. package/dist/comment-reaction-B8SfT-yM.mjs +85 -0
  379. package/dist/comment-reaction-B8SfT-yM.mjs.map +1 -0
  380. package/dist/comments-BRtp992B.mjs +99 -0
  381. package/dist/comments-BRtp992B.mjs.map +1 -0
  382. package/dist/comments-DVUYqdyC.mjs +195 -0
  383. package/dist/comments-DVUYqdyC.mjs.map +1 -0
  384. package/dist/components-CQY-Sgm-.mjs +108 -0
  385. package/dist/components-CQY-Sgm-.mjs.map +1 -0
  386. package/dist/config-B-uePMLj.d.mts +39 -0
  387. package/dist/config-B-uePMLj.d.mts.map +1 -0
  388. package/dist/config-B6BDSsz2.d.mts +6712 -0
  389. package/dist/config-B6BDSsz2.d.mts.map +1 -0
  390. package/dist/config-BsJHiQxC.mjs +228 -0
  391. package/dist/config-BsJHiQxC.mjs.map +1 -0
  392. package/dist/connection-B9pIasFd.mjs +36 -0
  393. package/dist/connection-B9pIasFd.mjs.map +1 -0
  394. package/dist/content-Dji9vEiW.mjs +2063 -0
  395. package/dist/content-Dji9vEiW.mjs.map +1 -0
  396. package/dist/content-list-query-DiNwyKtd.d.mts +26 -0
  397. package/dist/content-list-query-DiNwyKtd.d.mts.map +1 -0
  398. package/dist/content-repair-B7wnbzhN.mjs +442 -0
  399. package/dist/content-repair-B7wnbzhN.mjs.map +1 -0
  400. package/dist/context-Ctcxc8Ia.mjs +2026 -0
  401. package/dist/context-Ctcxc8Ia.mjs.map +1 -0
  402. package/dist/credits-Bu7dlobo.mjs +110 -0
  403. package/dist/credits-Bu7dlobo.mjs.map +1 -0
  404. package/dist/cron-xe5XKqA-.mjs +306 -0
  405. package/dist/cron-xe5XKqA-.mjs.map +1 -0
  406. package/dist/dashboard-B5hVHOtf.mjs +151 -0
  407. package/dist/dashboard-B5hVHOtf.mjs.map +1 -0
  408. package/dist/db/index.d.mts +3 -3
  409. package/dist/db/index.mjs +1 -1
  410. package/dist/db/index.mjs.map +1 -1
  411. package/dist/db/libsql-migrations.d.mts +1 -1
  412. package/dist/db/libsql-migrations.mjs +5 -5
  413. package/dist/db/libsql.d.mts +1 -1
  414. package/dist/db/postgres-migrations.d.mts +1 -1
  415. package/dist/db/postgres-migrations.mjs +4 -4
  416. package/dist/db/postgres.d.mts +1 -1
  417. package/dist/db/sqlite-migrations.d.mts +1 -1
  418. package/dist/db/sqlite-migrations.mjs +4 -4
  419. package/dist/db/sqlite.d.mts +1 -1
  420. package/dist/db/sqlite.mjs +1 -1
  421. package/dist/default-DaoYyFRS.mjs +81 -0
  422. package/dist/default-DaoYyFRS.mjs.map +1 -0
  423. package/dist/deferred-tasks-BYcDx2o_.d.mts +9 -0
  424. package/dist/deferred-tasks-BYcDx2o_.d.mts.map +1 -0
  425. package/dist/dev-typegen-Dtl8AfS6.mjs +29 -0
  426. package/dist/dev-typegen-Dtl8AfS6.mjs.map +1 -0
  427. package/dist/device-flow-Ma5P5d2e.mjs +521 -0
  428. package/dist/device-flow-Ma5P5d2e.mjs.map +1 -0
  429. package/dist/digest-xIpR3o64.mjs +194 -0
  430. package/dist/digest-xIpR3o64.mjs.map +1 -0
  431. package/dist/direct-executor-DMWwCey3.mjs +104 -0
  432. package/dist/direct-executor-DMWwCey3.mjs.map +1 -0
  433. package/dist/email-console-DmqVF5J_.mjs +50 -0
  434. package/dist/email-console-DmqVF5J_.mjs.map +1 -0
  435. package/dist/email-locale-Cc5YSXfJ.mjs +25 -0
  436. package/dist/email-locale-Cc5YSXfJ.mjs.map +1 -0
  437. package/dist/emdash-runtime-BlybX9Ui.mjs +4249 -0
  438. package/dist/emdash-runtime-BlybX9Ui.mjs.map +1 -0
  439. package/dist/enrich-Duu4sV3a.mjs +194 -0
  440. package/dist/enrich-Duu4sV3a.mjs.map +1 -0
  441. package/dist/entry-lock-De1L8qUQ.mjs +163 -0
  442. package/dist/entry-lock-De1L8qUQ.mjs.map +1 -0
  443. package/dist/entry-lock-esmMbgI9.d.mts +4551 -0
  444. package/dist/entry-lock-esmMbgI9.d.mts.map +1 -0
  445. package/dist/entry-lock-sxz2PGAT.mjs +1197 -0
  446. package/dist/entry-lock-sxz2PGAT.mjs.map +1 -0
  447. package/dist/env-types-BkjCtN13.mjs +38 -0
  448. package/dist/env-types-BkjCtN13.mjs.map +1 -0
  449. package/dist/error-B0rgPgsQ.mjs +90 -0
  450. package/dist/error-B0rgPgsQ.mjs.map +1 -0
  451. package/dist/errors-CuHQRiBW.mjs +120 -0
  452. package/dist/errors-CuHQRiBW.mjs.map +1 -0
  453. package/dist/errors-DTE6C3K_.mjs +470 -0
  454. package/dist/errors-DTE6C3K_.mjs.map +1 -0
  455. package/dist/escape-nJW7dR0s.mjs +9 -0
  456. package/dist/escape-nJW7dR0s.mjs.map +1 -0
  457. package/dist/fence-CGw57S4v.mjs +162 -0
  458. package/dist/fence-CGw57S4v.mjs.map +1 -0
  459. package/dist/field-defs-cache-Bw8w499w.mjs +77 -0
  460. package/dist/field-defs-cache-Bw8w499w.mjs.map +1 -0
  461. package/dist/field-map-hn-D-SyH.mjs +83 -0
  462. package/dist/field-map-hn-D-SyH.mjs.map +1 -0
  463. package/dist/fts-manager-DacCYIe4.mjs +443 -0
  464. package/dist/fts-manager-DacCYIe4.mjs.map +1 -0
  465. package/dist/gc-BBplHrv6.mjs +75 -0
  466. package/dist/gc-BBplHrv6.mjs.map +1 -0
  467. package/dist/hash-C4DFoJ7Z.mjs +37 -0
  468. package/dist/hash-C4DFoJ7Z.mjs.map +1 -0
  469. package/dist/hook-result-DSRRxu_-.d.mts +31 -0
  470. package/dist/hook-result-DSRRxu_-.d.mts.map +1 -0
  471. package/dist/hreflang-CKPunvU0.mjs +105 -0
  472. package/dist/hreflang-CKPunvU0.mjs.map +1 -0
  473. package/dist/hreflang-egumj6WF.d.mts +50 -0
  474. package/dist/hreflang-egumj6WF.d.mts.map +1 -0
  475. package/dist/http-route-dispatch-DjNFZcJ2.mjs +339 -0
  476. package/dist/http-route-dispatch-DjNFZcJ2.mjs.map +1 -0
  477. package/dist/identity-Dfrx2_Bc.mjs +35 -0
  478. package/dist/identity-Dfrx2_Bc.mjs.map +1 -0
  479. package/dist/import-ROBvhbNc.mjs +2021 -0
  480. package/dist/import-ROBvhbNc.mjs.map +1 -0
  481. package/dist/index-B4sIdCAT.d.mts +623 -0
  482. package/dist/index-B4sIdCAT.d.mts.map +1 -0
  483. package/dist/index.d.mts +24 -24
  484. package/dist/index.mjs +98 -97
  485. package/dist/init-lock-BGmew3r1.mjs +56 -0
  486. package/dist/init-lock-BGmew3r1.mjs.map +1 -0
  487. package/dist/install-finalization-CPM7Gged.mjs +58 -0
  488. package/dist/install-finalization-CPM7Gged.mjs.map +1 -0
  489. package/dist/keys-DxqxcAD4.mjs +61 -0
  490. package/dist/keys-DxqxcAD4.mjs.map +1 -0
  491. package/dist/kinds-BQl5gN6e.mjs +974 -0
  492. package/dist/kinds-BQl5gN6e.mjs.map +1 -0
  493. package/dist/lifecycle-DGQI7itS.mjs +25 -0
  494. package/dist/lifecycle-DGQI7itS.mjs.map +1 -0
  495. package/dist/load-DMxRl4VK.mjs +28 -0
  496. package/dist/load-DMxRl4VK.mjs.map +1 -0
  497. package/dist/loader-1DMiOq5s.mjs +1303 -0
  498. package/dist/loader-1DMiOq5s.mjs.map +1 -0
  499. package/dist/loops-Dn1i16FP.mjs +205 -0
  500. package/dist/loops-Dn1i16FP.mjs.map +1 -0
  501. package/dist/manifest-builder-CTw4FmZk.mjs +189 -0
  502. package/dist/manifest-builder-CTw4FmZk.mjs.map +1 -0
  503. package/dist/manifest-schema-gy37bD_D.mjs +496 -0
  504. package/dist/manifest-schema-gy37bD_D.mjs.map +1 -0
  505. package/dist/marketplace-tHWSsCUo.mjs +257 -0
  506. package/dist/marketplace-tHWSsCUo.mjs.map +1 -0
  507. package/dist/media/index.d.mts +1 -1
  508. package/dist/media/index.mjs +1 -1
  509. package/dist/media/local-runtime.d.mts +14 -14
  510. package/dist/media/local-runtime.mjs +7 -7
  511. package/dist/media-Bw-Q65ve.mjs +294 -0
  512. package/dist/media-Bw-Q65ve.mjs.map +1 -0
  513. package/dist/media-BzUDu7nl.mjs +373 -0
  514. package/dist/media-BzUDu7nl.mjs.map +1 -0
  515. package/dist/media-aahnKHze.mjs +408 -0
  516. package/dist/media-aahnKHze.mjs.map +1 -0
  517. package/dist/media-allowlist-RMrjo8TU.mjs +45 -0
  518. package/dist/media-allowlist-RMrjo8TU.mjs.map +1 -0
  519. package/dist/media-folders-kabR1oJf.mjs +210 -0
  520. package/dist/media-folders-kabR1oJf.mjs.map +1 -0
  521. package/dist/media-url-DloW2xrP.mjs +43 -0
  522. package/dist/media-url-DloW2xrP.mjs.map +1 -0
  523. package/dist/media-usage-CHHpV7ee.mjs +282 -0
  524. package/dist/media-usage-CHHpV7ee.mjs.map +1 -0
  525. package/dist/media-usage-activation-BinYqC_r.mjs +78 -0
  526. package/dist/media-usage-activation-BinYqC_r.mjs.map +1 -0
  527. package/dist/media-usage-work-C734aq6s.mjs +1015 -0
  528. package/dist/media-usage-work-C734aq6s.mjs.map +1 -0
  529. package/dist/media-usage-work-lxvV0-UO.mjs +151 -0
  530. package/dist/media-usage-work-lxvV0-UO.mjs.map +1 -0
  531. package/dist/menus-6RHNq4ZK.mjs +753 -0
  532. package/dist/menus-6RHNq4ZK.mjs.map +1 -0
  533. package/dist/menus-AuCTaO9W.mjs +3704 -0
  534. package/dist/menus-AuCTaO9W.mjs.map +1 -0
  535. package/dist/menus-BQKqf0Up.mjs +92 -0
  536. package/dist/menus-BQKqf0Up.mjs.map +1 -0
  537. package/dist/migrations/index.d.mts +1 -1
  538. package/dist/migrations/index.mjs +3 -3
  539. package/dist/mime-B5M9R53H.mjs +81 -0
  540. package/dist/mime-B5M9R53H.mjs.map +1 -0
  541. package/dist/mode-nh0ppSX5.mjs +23 -0
  542. package/dist/mode-nh0ppSX5.mjs.map +1 -0
  543. package/dist/node-sqlite-compat-CDOEcc97.mjs +63 -0
  544. package/dist/node-sqlite-compat-CDOEcc97.mjs.map +1 -0
  545. package/dist/oauth-authorization-BtYQ80uU.mjs +274 -0
  546. package/dist/oauth-authorization-BtYQ80uU.mjs.map +1 -0
  547. package/dist/oauth-clients-C1S4NQHh.mjs +266 -0
  548. package/dist/oauth-clients-C1S4NQHh.mjs.map +1 -0
  549. package/dist/oauth-state-store-CpGi2FZH.mjs +50 -0
  550. package/dist/oauth-state-store-CpGi2FZH.mjs.map +1 -0
  551. package/dist/oauth-user-lookup-BNp1aFAr.mjs +26 -0
  552. package/dist/oauth-user-lookup-BNp1aFAr.mjs.map +1 -0
  553. package/dist/object-cache/memory.d.mts +1 -1
  554. package/dist/options-B41aLm1I.d.mts +81 -0
  555. package/dist/options-B41aLm1I.d.mts.map +1 -0
  556. package/dist/ownership-DoeAIuTg.mjs +12 -0
  557. package/dist/ownership-DoeAIuTg.mjs.map +1 -0
  558. package/dist/page/index.d.mts +2 -2
  559. package/dist/page/index.mjs +6 -6
  560. package/dist/parse-CmFDTGzp.mjs +81 -0
  561. package/dist/parse-CmFDTGzp.mjs.map +1 -0
  562. package/dist/parse-QVS0t5oR.d.mts +172 -0
  563. package/dist/parse-QVS0t5oR.d.mts.map +1 -0
  564. package/dist/passkey-config-C-MxsV22.mjs +46 -0
  565. package/dist/passkey-config-C-MxsV22.mjs.map +1 -0
  566. package/dist/paths-kr8hAMMI.mjs +77 -0
  567. package/dist/paths-kr8hAMMI.mjs.map +1 -0
  568. package/dist/placeholder-Dn7MMdWr.d.mts +306 -0
  569. package/dist/placeholder-Dn7MMdWr.d.mts.map +1 -0
  570. package/dist/plan-CuQOeU9g.mjs +135 -0
  571. package/dist/plan-CuQOeU9g.mjs.map +1 -0
  572. package/dist/plugin-test-runtime.d.mts +14 -14
  573. package/dist/plugin-test-runtime.mjs +110 -109
  574. package/dist/plugin-types.d.mts +2 -2
  575. package/dist/plugin-utils.d.mts +12 -12
  576. package/dist/plugins/adapt-sandbox-entry.d.mts +12 -12
  577. package/dist/plugins/adapt-sandbox-entry.mjs +3 -3
  578. package/dist/plugins/host.d.mts +5 -5
  579. package/dist/plugins/host.mjs +44 -43
  580. package/dist/plugins-CGb-G98c.mjs +261 -0
  581. package/dist/plugins-CGb-G98c.mjs.map +1 -0
  582. package/dist/policy-C5wrDXYV.mjs +45 -0
  583. package/dist/policy-C5wrDXYV.mjs.map +1 -0
  584. package/dist/portable-text-BnRuiR1-.mjs +307 -0
  585. package/dist/portable-text-BnRuiR1-.mjs.map +1 -0
  586. package/dist/preview-xWNSR1Li.mjs +107 -0
  587. package/dist/preview-xWNSR1Li.mjs.map +1 -0
  588. package/dist/protocol-ClxN-m1e.d.mts +61 -0
  589. package/dist/protocol-ClxN-m1e.d.mts.map +1 -0
  590. package/dist/public-submission-CkmT2SKv.mjs +250 -0
  591. package/dist/public-submission-CkmT2SKv.mjs.map +1 -0
  592. package/dist/public-url-B5a0QAh6.mjs +101 -0
  593. package/dist/public-url-B5a0QAh6.mjs.map +1 -0
  594. package/dist/query-DHqFiqqH.mjs +41 -0
  595. package/dist/query-DHqFiqqH.mjs.map +1 -0
  596. package/dist/query-DT85BehD.mjs +1125 -0
  597. package/dist/query-DT85BehD.mjs.map +1 -0
  598. package/dist/rate-limit-iMvcu3eu.mjs +120 -0
  599. package/dist/rate-limit-iMvcu3eu.mjs.map +1 -0
  600. package/dist/receipt-Dpp1uaX9.mjs +43 -0
  601. package/dist/receipt-Dpp1uaX9.mjs.map +1 -0
  602. package/dist/redirect-BRoLiWQE.mjs +19 -0
  603. package/dist/redirect-BRoLiWQE.mjs.map +1 -0
  604. package/dist/redirect-xZNpBoGp.mjs +417 -0
  605. package/dist/redirect-xZNpBoGp.mjs.map +1 -0
  606. package/dist/redirects-D4EWeXAo.mjs +148 -0
  607. package/dist/redirects-D4EWeXAo.mjs.map +1 -0
  608. package/dist/redirects-DCKqwiWp.mjs +446 -0
  609. package/dist/redirects-DCKqwiWp.mjs.map +1 -0
  610. package/dist/registry/testing.mjs +3 -3
  611. package/dist/registry-DaXmUsD4.mjs +8369 -0
  612. package/dist/registry-DaXmUsD4.mjs.map +1 -0
  613. package/dist/relations-JvBP8nGP.mjs +776 -0
  614. package/dist/relations-JvBP8nGP.mjs.map +1 -0
  615. package/dist/request-context.d.mts +2 -2
  616. package/dist/request-context.mjs.map +1 -1
  617. package/dist/request-meta-B6blULFY.mjs +141 -0
  618. package/dist/request-meta-B6blULFY.mjs.map +1 -0
  619. package/dist/resolve-DAhHi5tn.mjs +100 -0
  620. package/dist/resolve-DAhHi5tn.mjs.map +1 -0
  621. package/dist/revision-BWEH2qQB.mjs +368 -0
  622. package/dist/revision-BWEH2qQB.mjs.map +1 -0
  623. package/dist/route-wire-DK600v4u.mjs +197 -0
  624. package/dist/route-wire-DK600v4u.mjs.map +1 -0
  625. package/dist/routes-BeZyaCzv.mjs +272 -0
  626. package/dist/routes-BeZyaCzv.mjs.map +1 -0
  627. package/dist/runner-CskI4Hmq.mjs +6372 -0
  628. package/dist/runner-CskI4Hmq.mjs.map +1 -0
  629. package/dist/runner-J3Cj6DGk.d.mts +68 -0
  630. package/dist/runner-J3Cj6DGk.d.mts.map +1 -0
  631. package/dist/runtime.d.mts +13 -13
  632. package/dist/runtime.mjs +3 -3
  633. package/dist/schema/project-env-types.mjs +37 -37
  634. package/dist/schema-CK0ihqMR.mjs +815 -0
  635. package/dist/schema-CK0ihqMR.mjs.map +1 -0
  636. package/dist/schema-VtaZSrC-.mjs +13 -0
  637. package/dist/schema-VtaZSrC-.mjs.map +1 -0
  638. package/dist/scopes-BRnGlL9t.mjs +34 -0
  639. package/dist/scopes-BRnGlL9t.mjs.map +1 -0
  640. package/dist/search-D6-XK1Sn.mjs +448 -0
  641. package/dist/search-D6-XK1Sn.mjs.map +1 -0
  642. package/dist/secrets-Cc_O3Kp-.mjs +369 -0
  643. package/dist/secrets-Cc_O3Kp-.mjs.map +1 -0
  644. package/dist/sections-CBDCf7qR.mjs +346 -0
  645. package/dist/sections-CBDCf7qR.mjs.map +1 -0
  646. package/dist/seed/index.d.mts +2 -2
  647. package/dist/seed/index.mjs +35 -35
  648. package/dist/seo/index.d.mts +3 -3
  649. package/dist/seo/index.mjs +22 -22
  650. package/dist/seo-BdeEPDNW.mjs +133 -0
  651. package/dist/seo-BdeEPDNW.mjs.map +1 -0
  652. package/dist/seo-C61bnPuV.mjs +114 -0
  653. package/dist/seo-C61bnPuV.mjs.map +1 -0
  654. package/dist/service-BuRKLMxa.mjs +150 -0
  655. package/dist/service-BuRKLMxa.mjs.map +1 -0
  656. package/dist/session-user-CqkPtrPL.mjs +61 -0
  657. package/dist/session-user-CqkPtrPL.mjs.map +1 -0
  658. package/dist/settings-0u0lTthS.mjs +51 -0
  659. package/dist/settings-0u0lTthS.mjs.map +1 -0
  660. package/dist/settings-WHr45II1.mjs +61 -0
  661. package/dist/settings-WHr45II1.mjs.map +1 -0
  662. package/dist/settings-m5tIYnF0.mjs +443 -0
  663. package/dist/settings-m5tIYnF0.mjs.map +1 -0
  664. package/dist/setup-complete-B2_dhZZz.mjs +65 -0
  665. package/dist/setup-complete-B2_dhZZz.mjs.map +1 -0
  666. package/dist/setup-nonce-CJV9ftSK.mjs +25 -0
  667. package/dist/setup-nonce-CJV9ftSK.mjs.map +1 -0
  668. package/dist/single-flight-cache-D0EaGbN1.mjs +104 -0
  669. package/dist/single-flight-cache-D0EaGbN1.mjs.map +1 -0
  670. package/dist/site-settings-KJOqJW6W.mjs +50 -0
  671. package/dist/site-settings-KJOqJW6W.mjs.map +1 -0
  672. package/dist/site-url-Ceq_AUK0.mjs +16 -0
  673. package/dist/site-url-Ceq_AUK0.mjs.map +1 -0
  674. package/dist/snapshot-Dzsn3NZa.mjs +414 -0
  675. package/dist/snapshot-Dzsn3NZa.mjs.map +1 -0
  676. package/dist/ssrf-DsmvZB80.mjs +406 -0
  677. package/dist/ssrf-DsmvZB80.mjs.map +1 -0
  678. package/dist/stage-Csnh_yEd.mjs +662 -0
  679. package/dist/stage-Csnh_yEd.mjs.map +1 -0
  680. package/dist/staged-Q7pnEVvI.mjs +686 -0
  681. package/dist/staged-Q7pnEVvI.mjs.map +1 -0
  682. package/dist/state-kGdOMQRY.mjs +153 -0
  683. package/dist/state-kGdOMQRY.mjs.map +1 -0
  684. package/dist/status-D39Fpy8R.mjs +30 -0
  685. package/dist/status-D39Fpy8R.mjs.map +1 -0
  686. package/dist/storage/local.d.mts +1 -1
  687. package/dist/storage/local.mjs +2 -2
  688. package/dist/storage/s3.d.mts +1 -1
  689. package/dist/storage/s3.mjs +1 -1
  690. package/dist/storage-query-C7iy6eUb.d.mts +1615 -0
  691. package/dist/storage-query-C7iy6eUb.d.mts.map +1 -0
  692. package/dist/tar-BWiraSUY.mjs +449 -0
  693. package/dist/tar-BWiraSUY.mjs.map +1 -0
  694. package/dist/target-DOFs5oUC.mjs +27 -0
  695. package/dist/target-DOFs5oUC.mjs.map +1 -0
  696. package/dist/taxonomies-BS40Wxvi.mjs +939 -0
  697. package/dist/taxonomies-BS40Wxvi.mjs.map +1 -0
  698. package/dist/taxonomies-DAZU9VDd.mjs +697 -0
  699. package/dist/taxonomies-DAZU9VDd.mjs.map +1 -0
  700. package/dist/taxonomy-XzLE95Vx.mjs +525 -0
  701. package/dist/taxonomy-XzLE95Vx.mjs.map +1 -0
  702. package/dist/tokens-DSQan4p7.mjs +171 -0
  703. package/dist/tokens-DSQan4p7.mjs.map +1 -0
  704. package/dist/transfer-BcCVxDgf.mjs +166 -0
  705. package/dist/transfer-BcCVxDgf.mjs.map +1 -0
  706. package/dist/transfer-OMrancOt.mjs +8873 -0
  707. package/dist/transfer-OMrancOt.mjs.map +1 -0
  708. package/dist/transfer-download-Dc-ltjZY.mjs +33 -0
  709. package/dist/transfer-download-Dc-ltjZY.mjs.map +1 -0
  710. package/dist/transformations-Ddx7UtrY.mjs +196 -0
  711. package/dist/transformations-Ddx7UtrY.mjs.map +1 -0
  712. package/dist/transport-flR-Zmds.d.mts +42 -0
  713. package/dist/transport-flR-Zmds.d.mts.map +1 -0
  714. package/dist/transport-umzEbgYO.mjs +136 -0
  715. package/dist/transport-umzEbgYO.mjs.map +1 -0
  716. package/dist/trusted-proxy-BqfQFs6a.mjs +51 -0
  717. package/dist/trusted-proxy-BqfQFs6a.mjs.map +1 -0
  718. package/dist/turnstile-Do60baId.mjs +58 -0
  719. package/dist/turnstile-Do60baId.mjs.map +1 -0
  720. package/dist/types-BT1p3uyb.d.mts +1735 -0
  721. package/dist/types-BT1p3uyb.d.mts.map +1 -0
  722. package/dist/types-BYaPWs_F.d.mts +198 -0
  723. package/dist/types-BYaPWs_F.d.mts.map +1 -0
  724. package/dist/types-C-Xp0CcN.mjs +103 -0
  725. package/dist/types-C-Xp0CcN.mjs.map +1 -0
  726. package/dist/types-CLTQ9b_r.d.mts +374 -0
  727. package/dist/types-CLTQ9b_r.d.mts.map +1 -0
  728. package/dist/types-CPkQw2T2.d.mts +85 -0
  729. package/dist/types-CPkQw2T2.d.mts.map +1 -0
  730. package/dist/types-CQLvuXoZ.d.mts +198 -0
  731. package/dist/types-CQLvuXoZ.d.mts.map +1 -0
  732. package/dist/types-CV5xszpF.d.mts +363 -0
  733. package/dist/types-CV5xszpF.d.mts.map +1 -0
  734. package/dist/types-CdEMurNh.mjs +77 -0
  735. package/dist/types-CdEMurNh.mjs.map +1 -0
  736. package/dist/types-Cj0_yZkn.mjs +18 -0
  737. package/dist/types-Cj0_yZkn.mjs.map +1 -0
  738. package/dist/types-CxwtnuSS.mjs +37 -0
  739. package/dist/types-CxwtnuSS.mjs.map +1 -0
  740. package/dist/types-DGw8KMX_.mjs +16 -0
  741. package/dist/types-DGw8KMX_.mjs.map +1 -0
  742. package/dist/types-DOfVMPoo.d.mts +125 -0
  743. package/dist/types-DOfVMPoo.d.mts.map +1 -0
  744. package/dist/types-LtS0SM4F.d.mts +287 -0
  745. package/dist/types-LtS0SM4F.d.mts.map +1 -0
  746. package/dist/types-ifgOkcBa.d.mts +916 -0
  747. package/dist/types-ifgOkcBa.d.mts.map +1 -0
  748. package/dist/update-check-DOc2aBIU.mjs +161 -0
  749. package/dist/update-check-DOc2aBIU.mjs.map +1 -0
  750. package/dist/upload-attempts-nzdc3cay.mjs +32 -0
  751. package/dist/upload-attempts-nzdc3cay.mjs.map +1 -0
  752. package/dist/url-pattern-hVbqpXs6.mjs +41 -0
  753. package/dist/url-pattern-hVbqpXs6.mjs.map +1 -0
  754. package/dist/user-Dnp53zTq.mjs +171 -0
  755. package/dist/user-Dnp53zTq.mjs.map +1 -0
  756. package/dist/utils-CoV-PYhg.mjs +439 -0
  757. package/dist/utils-CoV-PYhg.mjs.map +1 -0
  758. package/dist/validate-CfQ9_YlD.d.mts +468 -0
  759. package/dist/validate-CfQ9_YlD.d.mts.map +1 -0
  760. package/dist/validate-DBX3DKtL.mjs +516 -0
  761. package/dist/validate-DBX3DKtL.mjs.map +1 -0
  762. package/dist/validation-BJMiDhB1.mjs +219 -0
  763. package/dist/validation-BJMiDhB1.mjs.map +1 -0
  764. package/dist/version-BaT8yKIT.mjs +7 -0
  765. package/dist/version-BaT8yKIT.mjs.map +1 -0
  766. package/dist/version-BwEGkqkx.mjs +9 -0
  767. package/dist/version-BwEGkqkx.mjs.map +1 -0
  768. package/dist/virtual-modules-B6vJW15k.mjs +516 -0
  769. package/dist/virtual-modules-B6vJW15k.mjs.map +1 -0
  770. package/dist/widgets-BkxBAgZ_.mjs +126 -0
  771. package/dist/widgets-BkxBAgZ_.mjs.map +1 -0
  772. package/dist/wxr-taxonomies-D7gAJyOF.mjs +453 -0
  773. package/dist/wxr-taxonomies-D7gAJyOF.mjs.map +1 -0
  774. package/dist/wxr-taxonomies-DM5J9AsT.d.mts +34 -0
  775. package/dist/wxr-taxonomies-DM5J9AsT.d.mts.map +1 -0
  776. package/dist/zod-generator-BQilAboC.mjs +424 -0
  777. package/dist/zod-generator-BQilAboC.mjs.map +1 -0
  778. package/package.json +11 -5
  779. package/src/api/errors.ts +3 -0
  780. package/src/api/handlers/bylines.ts +24 -3
  781. package/src/api/handlers/calendar.ts +246 -0
  782. package/src/api/handlers/content.ts +12 -5
  783. package/src/api/handlers/media-allowlist.ts +1 -0
  784. package/src/api/handlers/media-upload.ts +13 -10
  785. package/src/api/handlers/plugins.ts +21 -29
  786. package/src/api/handlers/redirects.ts +6 -6
  787. package/src/api/schemas/bylines.ts +3 -1
  788. package/src/api/schemas/content.ts +16 -0
  789. package/src/astro/integration/index.ts +18 -1
  790. package/src/astro/integration/routes.ts +5 -0
  791. package/src/astro/integration/vite-config.ts +11 -0
  792. package/src/astro/middleware/csp.ts +1 -0
  793. package/src/astro/middleware/redirect.ts +20 -9
  794. package/src/astro/middleware/request-context.ts +54 -27
  795. package/src/astro/middleware.ts +97 -12
  796. package/src/astro/prefetch.ts +10 -3
  797. package/src/astro/routes/api/admin/bylines/[id]/translations.ts +0 -5
  798. package/src/astro/routes/api/admin/bylines/index.ts +1 -1
  799. package/src/astro/routes/api/admin/plugins/[id]/index.ts +1 -0
  800. package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +56 -4
  801. package/src/astro/routes/api/auth/oauth/[provider].ts +37 -4
  802. package/src/astro/routes/api/calendar.ts +35 -0
  803. package/src/astro/routes/api/media/upload-url.ts +8 -4
  804. package/src/astro/routes/api/media.ts +9 -5
  805. package/src/astro/routes/api/setup/index.ts +14 -2
  806. package/src/auth/providers/microsoft-admin.tsx +31 -0
  807. package/src/auth/providers/microsoft.ts +47 -0
  808. package/src/comments/turnstile.ts +6 -1
  809. package/src/components/HtmlBlock.astro +17 -6
  810. package/src/components/HtmlBlockFrame.astro +63 -0
  811. package/src/components/Iframe.astro +141 -0
  812. package/src/components/InlinePortableTextEditor.tsx +8 -7
  813. package/src/components/WebMcpSearch.astro +80 -0
  814. package/src/components/index.ts +5 -2
  815. package/src/components/webmcp-search.ts +142 -0
  816. package/src/config/secrets.ts +27 -15
  817. package/src/content/converters/portable-text-identity.ts +1 -0
  818. package/src/content/converters/portable-text-to-prosemirror.ts +36 -2
  819. package/src/content/converters/prosemirror-to-portable-text.ts +28 -2
  820. package/src/content/converters/types.ts +24 -0
  821. package/src/database/content-datetime.ts +11 -4
  822. package/src/database/migrations/090_redirect_enable_loop_guard.ts +70 -0
  823. package/src/database/migrations/091_redirect_artifacts.ts +141 -0
  824. package/src/database/migrations/runner.ts +4 -0
  825. package/src/database/repositories/content.ts +81 -26
  826. package/src/database/repositories/redirect.ts +6 -1
  827. package/src/database/request-scoped.ts +34 -0
  828. package/src/database/types.ts +23 -0
  829. package/src/db/adapters.ts +2 -0
  830. package/src/emdash-runtime.ts +28 -3
  831. package/src/import/menus.ts +3 -0
  832. package/src/index.ts +1 -0
  833. package/src/loader.ts +226 -55
  834. package/src/mcp/server.ts +12 -4
  835. package/src/media/mime.ts +21 -0
  836. package/src/menus/index.ts +30 -26
  837. package/src/plugins/hooks.ts +10 -0
  838. package/src/plugins/manager.ts +12 -2
  839. package/src/plugins/types.ts +16 -0
  840. package/src/query.ts +12 -29
  841. package/src/redirects/artifacts.ts +460 -0
  842. package/src/redirects/cache.ts +76 -41
  843. package/src/request-context.ts +1 -1
  844. package/src/seed/apply.ts +65 -57
  845. package/src/settings/index.ts +17 -12
  846. package/src/transfer/format/columns.ts +3 -0
  847. package/src/transfer/import/rebuild.ts +17 -2
  848. package/src/transfer/import/scaffold.ts +16 -9
  849. package/src/ui.ts +1 -0
  850. package/src/utils/sanitize.ts +14 -9
  851. package/src/virtual-modules.d.ts +3 -0
  852. package/dist/action-token-D2KE1Rqf.mjs +0 -26
  853. package/dist/action-token-D2KE1Rqf.mjs.map +0 -1
  854. package/dist/activation-DDuqAat2.mjs +0 -387
  855. package/dist/activation-DDuqAat2.mjs.map +0 -1
  856. package/dist/adapters-Ds-1Pmkm.d.mts +0 -171
  857. package/dist/adapters-Ds-1Pmkm.d.mts.map +0 -1
  858. package/dist/allowed-origins-D78QvbTO.mjs +0 -116
  859. package/dist/allowed-origins-D78QvbTO.mjs.map +0 -1
  860. package/dist/api-BBZlif0y.mjs +0 -4974
  861. package/dist/api-BBZlif0y.mjs.map +0 -1
  862. package/dist/api-tokens-BGbfWZVO.mjs +0 -166
  863. package/dist/api-tokens-BGbfWZVO.mjs.map +0 -1
  864. package/dist/apply-CDNV4JJ-.mjs +0 -1672
  865. package/dist/apply-CDNV4JJ-.mjs.map +0 -1
  866. package/dist/approvals-CVvJSEBF.mjs +0 -460
  867. package/dist/approvals-CVvJSEBF.mjs.map +0 -1
  868. package/dist/artifact-fetch-CGK0DQLj.mjs +0 -659
  869. package/dist/artifact-fetch-CGK0DQLj.mjs.map +0 -1
  870. package/dist/audit-BszbE_BP.mjs +0 -127
  871. package/dist/audit-BszbE_BP.mjs.map +0 -1
  872. package/dist/authoritative-records-ChM8dTeV.mjs +0 -5172
  873. package/dist/authoritative-records-ChM8dTeV.mjs.map +0 -1
  874. package/dist/authorize-CTGywswM.mjs +0 -49
  875. package/dist/authorize-CTGywswM.mjs.map +0 -1
  876. package/dist/backup-CDrPP8fI.mjs +0 -246
  877. package/dist/backup-CDrPP8fI.mjs.map +0 -1
  878. package/dist/base64-DvnNgP7e.mjs +0 -63
  879. package/dist/base64-DvnNgP7e.mjs.map +0 -1
  880. package/dist/block-types-nNEaPkvx.mjs +0 -132
  881. package/dist/block-types-nNEaPkvx.mjs.map +0 -1
  882. package/dist/block-values-Bho1nsZF.mjs +0 -175
  883. package/dist/block-values-Bho1nsZF.mjs.map +0 -1
  884. package/dist/byline-02tu_Uc-.mjs +0 -909
  885. package/dist/byline-02tu_Uc-.mjs.map +0 -1
  886. package/dist/byline-fields-BYbTptTU.mjs +0 -280
  887. package/dist/byline-fields-BYbTptTU.mjs.map +0 -1
  888. package/dist/byline-fields-BjQH-1z9.mjs +0 -123
  889. package/dist/byline-fields-BjQH-1z9.mjs.map +0 -1
  890. package/dist/bylines-VytjeHBI.mjs +0 -214
  891. package/dist/bylines-VytjeHBI.mjs.map +0 -1
  892. package/dist/bylines-gyWBWUUc.mjs +0 -150
  893. package/dist/bylines-gyWBWUUc.mjs.map +0 -1
  894. package/dist/cache-CPanL9IO.mjs +0 -114
  895. package/dist/cache-CPanL9IO.mjs.map +0 -1
  896. package/dist/canonical-CAecl1UQ.mjs +0 -174
  897. package/dist/canonical-CAecl1UQ.mjs.map +0 -1
  898. package/dist/capture-triggers-CdZfvHtF.mjs +0 -362
  899. package/dist/capture-triggers-CdZfvHtF.mjs.map +0 -1
  900. package/dist/challenge-store-VePApay4.mjs +0 -51
  901. package/dist/challenge-store-VePApay4.mjs.map +0 -1
  902. package/dist/checksum-BSIhEAYW.mjs +0 -162
  903. package/dist/checksum-BSIhEAYW.mjs.map +0 -1
  904. package/dist/chrome-tags-CKELm-bo.mjs +0 -24
  905. package/dist/chrome-tags-CKELm-bo.mjs.map +0 -1
  906. package/dist/chunks-DBmkKmBH.mjs +0 -25
  907. package/dist/chunks-DBmkKmBH.mjs.map +0 -1
  908. package/dist/collection-slugs-cache-BNRAPNiu.mjs +0 -85
  909. package/dist/collection-slugs-cache-BNRAPNiu.mjs.map +0 -1
  910. package/dist/comment-Cq1UYN8_.mjs +0 -313
  911. package/dist/comment-Cq1UYN8_.mjs.map +0 -1
  912. package/dist/comment-reaction-B5sZzSoA.mjs +0 -85
  913. package/dist/comment-reaction-B5sZzSoA.mjs.map +0 -1
  914. package/dist/comments-B3F-ETyh.mjs +0 -195
  915. package/dist/comments-B3F-ETyh.mjs.map +0 -1
  916. package/dist/comments-zrTgWBSg.mjs +0 -99
  917. package/dist/comments-zrTgWBSg.mjs.map +0 -1
  918. package/dist/components-Dbf4Eq16.mjs +0 -108
  919. package/dist/components-Dbf4Eq16.mjs.map +0 -1
  920. package/dist/config-BCM5sQP7.d.mts +0 -6688
  921. package/dist/config-BCM5sQP7.d.mts.map +0 -1
  922. package/dist/config-CXPcy2iY.mjs +0 -228
  923. package/dist/config-CXPcy2iY.mjs.map +0 -1
  924. package/dist/config-CZkZBuBK.d.mts +0 -39
  925. package/dist/config-CZkZBuBK.d.mts.map +0 -1
  926. package/dist/connection-C5GIciX9.mjs +0 -36
  927. package/dist/connection-C5GIciX9.mjs.map +0 -1
  928. package/dist/content-RzEXY3QX.mjs +0 -2020
  929. package/dist/content-RzEXY3QX.mjs.map +0 -1
  930. package/dist/content-list-query-B6P37Ug_.d.mts +0 -26
  931. package/dist/content-list-query-B6P37Ug_.d.mts.map +0 -1
  932. package/dist/content-repair-BDVsYXWK.mjs +0 -442
  933. package/dist/content-repair-BDVsYXWK.mjs.map +0 -1
  934. package/dist/context-BpTIzY5h.mjs +0 -2026
  935. package/dist/context-BpTIzY5h.mjs.map +0 -1
  936. package/dist/credits-JOE92Gr7.mjs +0 -110
  937. package/dist/credits-JOE92Gr7.mjs.map +0 -1
  938. package/dist/cron-ktyapbdB.mjs +0 -306
  939. package/dist/cron-ktyapbdB.mjs.map +0 -1
  940. package/dist/dashboard-BoV4pwPP.mjs +0 -151
  941. package/dist/dashboard-BoV4pwPP.mjs.map +0 -1
  942. package/dist/default-B7KnYwtQ.mjs +0 -81
  943. package/dist/default-B7KnYwtQ.mjs.map +0 -1
  944. package/dist/deferred-tasks-eaUIqXj8.d.mts +0 -9
  945. package/dist/deferred-tasks-eaUIqXj8.d.mts.map +0 -1
  946. package/dist/dev-typegen-8JlYYFno.mjs +0 -29
  947. package/dist/dev-typegen-8JlYYFno.mjs.map +0 -1
  948. package/dist/device-flow-BlV_z24g.mjs +0 -521
  949. package/dist/device-flow-BlV_z24g.mjs.map +0 -1
  950. package/dist/digest-DiYAoZpf.mjs +0 -194
  951. package/dist/digest-DiYAoZpf.mjs.map +0 -1
  952. package/dist/direct-executor-Db8xA3zg.mjs +0 -104
  953. package/dist/direct-executor-Db8xA3zg.mjs.map +0 -1
  954. package/dist/email-console-Dm78wSmg.mjs +0 -50
  955. package/dist/email-console-Dm78wSmg.mjs.map +0 -1
  956. package/dist/email-locale-B4X9LXe9.mjs +0 -25
  957. package/dist/email-locale-B4X9LXe9.mjs.map +0 -1
  958. package/dist/emdash-runtime-BakQ6io7.mjs +0 -4239
  959. package/dist/emdash-runtime-BakQ6io7.mjs.map +0 -1
  960. package/dist/enrich-BDdVNeDK.mjs +0 -194
  961. package/dist/enrich-BDdVNeDK.mjs.map +0 -1
  962. package/dist/entry-lock-DY8B-xcr.d.mts +0 -4544
  963. package/dist/entry-lock-DY8B-xcr.d.mts.map +0 -1
  964. package/dist/entry-lock-DrUAdTzf.mjs +0 -163
  965. package/dist/entry-lock-DrUAdTzf.mjs.map +0 -1
  966. package/dist/entry-lock-yIkBduqJ.mjs +0 -1180
  967. package/dist/entry-lock-yIkBduqJ.mjs.map +0 -1
  968. package/dist/env-types-DkHYR2pl.mjs +0 -38
  969. package/dist/env-types-DkHYR2pl.mjs.map +0 -1
  970. package/dist/error-DIYXAVk4.mjs +0 -90
  971. package/dist/error-DIYXAVk4.mjs.map +0 -1
  972. package/dist/errors-CNvATh_7.mjs +0 -469
  973. package/dist/errors-CNvATh_7.mjs.map +0 -1
  974. package/dist/errors-CjXd1LgH.mjs +0 -120
  975. package/dist/errors-CjXd1LgH.mjs.map +0 -1
  976. package/dist/escape-B1GM0yJU.mjs +0 -9
  977. package/dist/escape-B1GM0yJU.mjs.map +0 -1
  978. package/dist/fence-8MaKKWhp.mjs +0 -162
  979. package/dist/fence-8MaKKWhp.mjs.map +0 -1
  980. package/dist/field-defs-cache-DEkFYCDE.mjs +0 -77
  981. package/dist/field-defs-cache-DEkFYCDE.mjs.map +0 -1
  982. package/dist/field-map-D7ioN0r0.mjs +0 -83
  983. package/dist/field-map-D7ioN0r0.mjs.map +0 -1
  984. package/dist/fts-manager-DU03MxWu.mjs +0 -443
  985. package/dist/fts-manager-DU03MxWu.mjs.map +0 -1
  986. package/dist/gc-DMiE7ezk.mjs +0 -75
  987. package/dist/gc-DMiE7ezk.mjs.map +0 -1
  988. package/dist/hash-CY4QdeMJ.mjs +0 -37
  989. package/dist/hash-CY4QdeMJ.mjs.map +0 -1
  990. package/dist/hook-result-Cb67D3P3.d.mts +0 -31
  991. package/dist/hook-result-Cb67D3P3.d.mts.map +0 -1
  992. package/dist/hreflang-Bterc3b7.mjs +0 -105
  993. package/dist/hreflang-Bterc3b7.mjs.map +0 -1
  994. package/dist/hreflang-uIBOE5yg.d.mts +0 -50
  995. package/dist/hreflang-uIBOE5yg.d.mts.map +0 -1
  996. package/dist/http-route-dispatch-DubjTibD.mjs +0 -339
  997. package/dist/http-route-dispatch-DubjTibD.mjs.map +0 -1
  998. package/dist/identity-DJ-5AcdG.mjs +0 -35
  999. package/dist/identity-DJ-5AcdG.mjs.map +0 -1
  1000. package/dist/import-DEfuIgRz.mjs +0 -2020
  1001. package/dist/import-DEfuIgRz.mjs.map +0 -1
  1002. package/dist/index-xCy3j0f6.d.mts +0 -623
  1003. package/dist/index-xCy3j0f6.d.mts.map +0 -1
  1004. package/dist/init-lock-4eRRB4Le.mjs +0 -56
  1005. package/dist/init-lock-4eRRB4Le.mjs.map +0 -1
  1006. package/dist/install-finalization-DeGRbaVa.mjs +0 -58
  1007. package/dist/install-finalization-DeGRbaVa.mjs.map +0 -1
  1008. package/dist/keys-DWwMxdZh.mjs +0 -61
  1009. package/dist/keys-DWwMxdZh.mjs.map +0 -1
  1010. package/dist/kinds-D1A-00-F.mjs +0 -974
  1011. package/dist/kinds-D1A-00-F.mjs.map +0 -1
  1012. package/dist/lifecycle-BWtBGNEn.mjs +0 -25
  1013. package/dist/lifecycle-BWtBGNEn.mjs.map +0 -1
  1014. package/dist/load-BR1NEa_3.mjs +0 -28
  1015. package/dist/load-BR1NEa_3.mjs.map +0 -1
  1016. package/dist/loader-D4edocWH.mjs +0 -1197
  1017. package/dist/loader-D4edocWH.mjs.map +0 -1
  1018. package/dist/loops-DLaHFrvI.mjs +0 -205
  1019. package/dist/loops-DLaHFrvI.mjs.map +0 -1
  1020. package/dist/manifest-builder-8jsSLR7s.mjs +0 -189
  1021. package/dist/manifest-builder-8jsSLR7s.mjs.map +0 -1
  1022. package/dist/manifest-schema-DcZjRNEv.mjs +0 -496
  1023. package/dist/manifest-schema-DcZjRNEv.mjs.map +0 -1
  1024. package/dist/marketplace-CNxjq10S.mjs +0 -257
  1025. package/dist/marketplace-CNxjq10S.mjs.map +0 -1
  1026. package/dist/media-3v7mqAVX.mjs +0 -294
  1027. package/dist/media-3v7mqAVX.mjs.map +0 -1
  1028. package/dist/media-Bs6qmlVl.mjs +0 -408
  1029. package/dist/media-Bs6qmlVl.mjs.map +0 -1
  1030. package/dist/media-CputjGE1.mjs +0 -373
  1031. package/dist/media-CputjGE1.mjs.map +0 -1
  1032. package/dist/media-allowlist-isqF1gAh.mjs +0 -44
  1033. package/dist/media-allowlist-isqF1gAh.mjs.map +0 -1
  1034. package/dist/media-folders-D2VdVBf6.mjs +0 -210
  1035. package/dist/media-folders-D2VdVBf6.mjs.map +0 -1
  1036. package/dist/media-url-DbkMY3y6.mjs +0 -43
  1037. package/dist/media-url-DbkMY3y6.mjs.map +0 -1
  1038. package/dist/media-usage-activation-BaT4AlNI.mjs +0 -78
  1039. package/dist/media-usage-activation-BaT4AlNI.mjs.map +0 -1
  1040. package/dist/media-usage-v43L0kR_.mjs +0 -282
  1041. package/dist/media-usage-v43L0kR_.mjs.map +0 -1
  1042. package/dist/media-usage-work-CY8gIeU-.mjs +0 -151
  1043. package/dist/media-usage-work-CY8gIeU-.mjs.map +0 -1
  1044. package/dist/media-usage-work-VO108Q9E.mjs +0 -1015
  1045. package/dist/media-usage-work-VO108Q9E.mjs.map +0 -1
  1046. package/dist/menus-BYyeRemR.mjs +0 -3647
  1047. package/dist/menus-BYyeRemR.mjs.map +0 -1
  1048. package/dist/menus-mC_XTxD7.mjs +0 -92
  1049. package/dist/menus-mC_XTxD7.mjs.map +0 -1
  1050. package/dist/menus-trvc6_fW.mjs +0 -753
  1051. package/dist/menus-trvc6_fW.mjs.map +0 -1
  1052. package/dist/mime-IZf-LHIS.mjs +0 -36
  1053. package/dist/mime-IZf-LHIS.mjs.map +0 -1
  1054. package/dist/mode-B9-gMXL9.mjs +0 -23
  1055. package/dist/mode-B9-gMXL9.mjs.map +0 -1
  1056. package/dist/node-sqlite-compat-DztcWs4y.mjs +0 -63
  1057. package/dist/node-sqlite-compat-DztcWs4y.mjs.map +0 -1
  1058. package/dist/oauth-authorization-BIHy9SGU.mjs +0 -274
  1059. package/dist/oauth-authorization-BIHy9SGU.mjs.map +0 -1
  1060. package/dist/oauth-clients-BZWZvKXa.mjs +0 -266
  1061. package/dist/oauth-clients-BZWZvKXa.mjs.map +0 -1
  1062. package/dist/oauth-state-store-CxXTjXdI.mjs +0 -50
  1063. package/dist/oauth-state-store-CxXTjXdI.mjs.map +0 -1
  1064. package/dist/oauth-user-lookup-GWojfxRl.mjs +0 -26
  1065. package/dist/oauth-user-lookup-GWojfxRl.mjs.map +0 -1
  1066. package/dist/options-DRF6dlXY.d.mts +0 -81
  1067. package/dist/options-DRF6dlXY.d.mts.map +0 -1
  1068. package/dist/ownership-Bd77AmJz.mjs +0 -12
  1069. package/dist/ownership-Bd77AmJz.mjs.map +0 -1
  1070. package/dist/parse-5Y0W39xR.mjs +0 -81
  1071. package/dist/parse-5Y0W39xR.mjs.map +0 -1
  1072. package/dist/parse-BPblgoa-.d.mts +0 -172
  1073. package/dist/parse-BPblgoa-.d.mts.map +0 -1
  1074. package/dist/passkey-config-PiQ5cBnt.mjs +0 -46
  1075. package/dist/passkey-config-PiQ5cBnt.mjs.map +0 -1
  1076. package/dist/paths-DkS74lBM.mjs +0 -77
  1077. package/dist/paths-DkS74lBM.mjs.map +0 -1
  1078. package/dist/placeholder-Bez2282x.d.mts +0 -306
  1079. package/dist/placeholder-Bez2282x.d.mts.map +0 -1
  1080. package/dist/plan-Lw7iGnGD.mjs +0 -135
  1081. package/dist/plan-Lw7iGnGD.mjs.map +0 -1
  1082. package/dist/plugins-D7xSh1Lu.mjs +0 -277
  1083. package/dist/plugins-D7xSh1Lu.mjs.map +0 -1
  1084. package/dist/policy-DMRiMdLn.mjs +0 -45
  1085. package/dist/policy-DMRiMdLn.mjs.map +0 -1
  1086. package/dist/portable-text-kcyN3F-a.mjs +0 -307
  1087. package/dist/portable-text-kcyN3F-a.mjs.map +0 -1
  1088. package/dist/preview--2VDLaND.mjs +0 -107
  1089. package/dist/preview--2VDLaND.mjs.map +0 -1
  1090. package/dist/protocol-FvwLA8P-.d.mts +0 -61
  1091. package/dist/protocol-FvwLA8P-.d.mts.map +0 -1
  1092. package/dist/public-submission-BRyK76U8.mjs +0 -250
  1093. package/dist/public-submission-BRyK76U8.mjs.map +0 -1
  1094. package/dist/public-url-7j0cpCFc.mjs +0 -101
  1095. package/dist/public-url-7j0cpCFc.mjs.map +0 -1
  1096. package/dist/query-BRNTde3V.mjs +0 -41
  1097. package/dist/query-BRNTde3V.mjs.map +0 -1
  1098. package/dist/query-DyYYWOKk.mjs +0 -1161
  1099. package/dist/query-DyYYWOKk.mjs.map +0 -1
  1100. package/dist/rate-limit-D0BcE76H.mjs +0 -120
  1101. package/dist/rate-limit-D0BcE76H.mjs.map +0 -1
  1102. package/dist/receipt-C4icyHlC.mjs +0 -43
  1103. package/dist/receipt-C4icyHlC.mjs.map +0 -1
  1104. package/dist/redirect-9DbtxSNG.mjs +0 -19
  1105. package/dist/redirect-9DbtxSNG.mjs.map +0 -1
  1106. package/dist/redirect-BvFKh8Sz.mjs +0 -416
  1107. package/dist/redirect-BvFKh8Sz.mjs.map +0 -1
  1108. package/dist/redirects-1nhdEaTq.mjs +0 -148
  1109. package/dist/redirects-1nhdEaTq.mjs.map +0 -1
  1110. package/dist/redirects-D1yMnSR9.mjs +0 -446
  1111. package/dist/redirects-D1yMnSR9.mjs.map +0 -1
  1112. package/dist/registry-CzPJNu3H.mjs +0 -8366
  1113. package/dist/registry-CzPJNu3H.mjs.map +0 -1
  1114. package/dist/relations-C8JpSkU6.mjs +0 -776
  1115. package/dist/relations-C8JpSkU6.mjs.map +0 -1
  1116. package/dist/request-meta-Bs60XW1m.mjs +0 -141
  1117. package/dist/request-meta-Bs60XW1m.mjs.map +0 -1
  1118. package/dist/resolve-BHWgMU_X.mjs +0 -100
  1119. package/dist/resolve-BHWgMU_X.mjs.map +0 -1
  1120. package/dist/revision-CGkQA0e5.mjs +0 -366
  1121. package/dist/revision-CGkQA0e5.mjs.map +0 -1
  1122. package/dist/route-wire-ClUVQduA.mjs +0 -197
  1123. package/dist/route-wire-ClUVQduA.mjs.map +0 -1
  1124. package/dist/routes-D2GFl3B7.mjs +0 -272
  1125. package/dist/routes-D2GFl3B7.mjs.map +0 -1
  1126. package/dist/runner-CLpxmhl8.mjs +0 -6197
  1127. package/dist/runner-CLpxmhl8.mjs.map +0 -1
  1128. package/dist/runner-CWl76CH3.d.mts +0 -68
  1129. package/dist/runner-CWl76CH3.d.mts.map +0 -1
  1130. package/dist/schema-27XefSYG.mjs +0 -13
  1131. package/dist/schema-27XefSYG.mjs.map +0 -1
  1132. package/dist/schema-Btvj3BMh.mjs +0 -815
  1133. package/dist/schema-Btvj3BMh.mjs.map +0 -1
  1134. package/dist/scopes-DGCj6K4p.mjs +0 -34
  1135. package/dist/scopes-DGCj6K4p.mjs.map +0 -1
  1136. package/dist/search-pZRRmWjh.mjs +0 -448
  1137. package/dist/search-pZRRmWjh.mjs.map +0 -1
  1138. package/dist/secrets-CIi0nFiR.mjs +0 -341
  1139. package/dist/secrets-CIi0nFiR.mjs.map +0 -1
  1140. package/dist/sections-CIhqs3Ao.mjs +0 -346
  1141. package/dist/sections-CIhqs3Ao.mjs.map +0 -1
  1142. package/dist/seo-DifeiGdl.mjs +0 -114
  1143. package/dist/seo-DifeiGdl.mjs.map +0 -1
  1144. package/dist/seo-DpYxmGaL.mjs +0 -133
  1145. package/dist/seo-DpYxmGaL.mjs.map +0 -1
  1146. package/dist/service-COVdVpSK.mjs +0 -150
  1147. package/dist/service-COVdVpSK.mjs.map +0 -1
  1148. package/dist/session-user-C6IEjuty.mjs +0 -61
  1149. package/dist/session-user-C6IEjuty.mjs.map +0 -1
  1150. package/dist/settings-CwcrX-Ay.mjs +0 -61
  1151. package/dist/settings-CwcrX-Ay.mjs.map +0 -1
  1152. package/dist/settings-D_cJtT48.mjs +0 -439
  1153. package/dist/settings-D_cJtT48.mjs.map +0 -1
  1154. package/dist/settings-tnPQN3Z2.mjs +0 -51
  1155. package/dist/settings-tnPQN3Z2.mjs.map +0 -1
  1156. package/dist/setup-complete-BOrI10UY.mjs +0 -65
  1157. package/dist/setup-complete-BOrI10UY.mjs.map +0 -1
  1158. package/dist/setup-nonce-0XTBLTsX.mjs +0 -25
  1159. package/dist/setup-nonce-0XTBLTsX.mjs.map +0 -1
  1160. package/dist/single-flight-cache-B5O2qhO1.mjs +0 -104
  1161. package/dist/single-flight-cache-B5O2qhO1.mjs.map +0 -1
  1162. package/dist/site-settings-B7vGFRDT.mjs +0 -50
  1163. package/dist/site-settings-B7vGFRDT.mjs.map +0 -1
  1164. package/dist/site-url-wEYRMHBv.mjs +0 -16
  1165. package/dist/site-url-wEYRMHBv.mjs.map +0 -1
  1166. package/dist/snapshot-W36KbLmc.mjs +0 -414
  1167. package/dist/snapshot-W36KbLmc.mjs.map +0 -1
  1168. package/dist/ssrf-CRJ-xom5.mjs +0 -406
  1169. package/dist/ssrf-CRJ-xom5.mjs.map +0 -1
  1170. package/dist/stage-DA0NrTRZ.mjs +0 -662
  1171. package/dist/stage-DA0NrTRZ.mjs.map +0 -1
  1172. package/dist/staged-Bw5eHbKS.mjs +0 -686
  1173. package/dist/staged-Bw5eHbKS.mjs.map +0 -1
  1174. package/dist/state-BTlprvUF.mjs +0 -153
  1175. package/dist/state-BTlprvUF.mjs.map +0 -1
  1176. package/dist/status-C6IrSLMT.mjs +0 -30
  1177. package/dist/status-C6IrSLMT.mjs.map +0 -1
  1178. package/dist/storage-query-CdVF2bng.d.mts +0 -1614
  1179. package/dist/storage-query-CdVF2bng.d.mts.map +0 -1
  1180. package/dist/tar-BGOZARjy.mjs +0 -449
  1181. package/dist/tar-BGOZARjy.mjs.map +0 -1
  1182. package/dist/target-YhYH_0uc.mjs +0 -27
  1183. package/dist/target-YhYH_0uc.mjs.map +0 -1
  1184. package/dist/taxonomies-DK_XBrmT.mjs +0 -697
  1185. package/dist/taxonomies-DK_XBrmT.mjs.map +0 -1
  1186. package/dist/taxonomies-S1M3rUC0.mjs +0 -939
  1187. package/dist/taxonomies-S1M3rUC0.mjs.map +0 -1
  1188. package/dist/taxonomy-BesdHIwi.mjs +0 -525
  1189. package/dist/taxonomy-BesdHIwi.mjs.map +0 -1
  1190. package/dist/tokens-B_ffPF1q.mjs +0 -171
  1191. package/dist/tokens-B_ffPF1q.mjs.map +0 -1
  1192. package/dist/transfer-9fVSxyrV.mjs +0 -166
  1193. package/dist/transfer-9fVSxyrV.mjs.map +0 -1
  1194. package/dist/transfer-B7LUTaYD.mjs +0 -8855
  1195. package/dist/transfer-B7LUTaYD.mjs.map +0 -1
  1196. package/dist/transfer-download-BdNq4VWN.mjs +0 -33
  1197. package/dist/transfer-download-BdNq4VWN.mjs.map +0 -1
  1198. package/dist/transformations-BtQdvyly.mjs +0 -196
  1199. package/dist/transformations-BtQdvyly.mjs.map +0 -1
  1200. package/dist/transport-CriYXY1c.mjs +0 -136
  1201. package/dist/transport-CriYXY1c.mjs.map +0 -1
  1202. package/dist/transport-SnhS6xku.d.mts +0 -42
  1203. package/dist/transport-SnhS6xku.d.mts.map +0 -1
  1204. package/dist/trusted-proxy-C0eHXPd-.mjs +0 -51
  1205. package/dist/trusted-proxy-C0eHXPd-.mjs.map +0 -1
  1206. package/dist/turnstile-BNPrWd1e.mjs +0 -53
  1207. package/dist/turnstile-BNPrWd1e.mjs.map +0 -1
  1208. package/dist/types-B8sF_kE5.d.mts +0 -287
  1209. package/dist/types-B8sF_kE5.d.mts.map +0 -1
  1210. package/dist/types-BYVIYOlD.d.mts +0 -1720
  1211. package/dist/types-BYVIYOlD.d.mts.map +0 -1
  1212. package/dist/types-Bs4bi95j.d.mts +0 -374
  1213. package/dist/types-Bs4bi95j.d.mts.map +0 -1
  1214. package/dist/types-CGuODCZi.d.mts +0 -198
  1215. package/dist/types-CGuODCZi.d.mts.map +0 -1
  1216. package/dist/types-CVsmpTcU.mjs +0 -18
  1217. package/dist/types-CVsmpTcU.mjs.map +0 -1
  1218. package/dist/types-ClFEExxn.mjs +0 -37
  1219. package/dist/types-ClFEExxn.mjs.map +0 -1
  1220. package/dist/types-D994zUWB.d.mts +0 -85
  1221. package/dist/types-D994zUWB.d.mts.map +0 -1
  1222. package/dist/types-DAj1ByJQ.d.mts +0 -125
  1223. package/dist/types-DAj1ByJQ.d.mts.map +0 -1
  1224. package/dist/types-Dlv6esp4.mjs +0 -77
  1225. package/dist/types-Dlv6esp4.mjs.map +0 -1
  1226. package/dist/types-Dr1LVwL7.d.mts +0 -363
  1227. package/dist/types-Dr1LVwL7.d.mts.map +0 -1
  1228. package/dist/types-MN9bOQ1g.d.mts +0 -198
  1229. package/dist/types-MN9bOQ1g.d.mts.map +0 -1
  1230. package/dist/types-d2Szb1oz.mjs +0 -16
  1231. package/dist/types-d2Szb1oz.mjs.map +0 -1
  1232. package/dist/types-ibtP7GEA.d.mts +0 -896
  1233. package/dist/types-ibtP7GEA.d.mts.map +0 -1
  1234. package/dist/types-j6MBDjlZ.mjs +0 -103
  1235. package/dist/types-j6MBDjlZ.mjs.map +0 -1
  1236. package/dist/update-check-D8No-E5s.mjs +0 -161
  1237. package/dist/update-check-D8No-E5s.mjs.map +0 -1
  1238. package/dist/upload-attempts-BodUoFBu.mjs +0 -32
  1239. package/dist/upload-attempts-BodUoFBu.mjs.map +0 -1
  1240. package/dist/url-pattern-DGAG6ZP2.mjs +0 -41
  1241. package/dist/url-pattern-DGAG6ZP2.mjs.map +0 -1
  1242. package/dist/user-BOvuF1sQ.mjs +0 -171
  1243. package/dist/user-BOvuF1sQ.mjs.map +0 -1
  1244. package/dist/utils-Dr01wRKt.mjs +0 -439
  1245. package/dist/utils-Dr01wRKt.mjs.map +0 -1
  1246. package/dist/validate-BttYU7NK.mjs +0 -516
  1247. package/dist/validate-BttYU7NK.mjs.map +0 -1
  1248. package/dist/validate-Df09inbC.d.mts +0 -468
  1249. package/dist/validate-Df09inbC.d.mts.map +0 -1
  1250. package/dist/validation-DH2WRwWO.mjs +0 -219
  1251. package/dist/validation-DH2WRwWO.mjs.map +0 -1
  1252. package/dist/version-BbygH8CT.mjs +0 -7
  1253. package/dist/version-BbygH8CT.mjs.map +0 -1
  1254. package/dist/version-CseoDDOd.mjs +0 -9
  1255. package/dist/version-CseoDDOd.mjs.map +0 -1
  1256. package/dist/virtual-modules-82GlnQyG.mjs +0 -516
  1257. package/dist/virtual-modules-82GlnQyG.mjs.map +0 -1
  1258. package/dist/widgets-DMAgGcQt.mjs +0 -126
  1259. package/dist/widgets-DMAgGcQt.mjs.map +0 -1
  1260. package/dist/wxr-taxonomies-Bi5kFSxQ.mjs +0 -453
  1261. package/dist/wxr-taxonomies-Bi5kFSxQ.mjs.map +0 -1
  1262. package/dist/wxr-taxonomies-y_FpYlDn.d.mts +0 -34
  1263. package/dist/wxr-taxonomies-y_FpYlDn.d.mts.map +0 -1
  1264. package/dist/zod-generator-DnfG5sGQ.mjs +0 -424
  1265. package/dist/zod-generator-DnfG5sGQ.mjs.map +0 -1
  1266. /package/dist/{api-tokens-B4COohsb.mjs → api-tokens-BLz2MtQs.mjs} +0 -0
  1267. /package/dist/{ssrf-sC4_5rxm.mjs → ssrf-tA45vIPX.mjs} +0 -0
@@ -1,37 +0,0 @@
1
- import { CAPABILITY_RENAMES, isDeprecatedCapability, normalizeCapabilities, normalizeCapability } from "@emdash-cms/plugin-types";
2
-
3
- //#region src/plugins/types.ts
4
- const PLUGIN_CAPABILITY_IMPLICATIONS = [
5
- ["content:write", "content:read"],
6
- ["content:revisions:read", "content:read"],
7
- ["taxonomies:write", "taxonomies:read"],
8
- ["content:publish", "content:read"],
9
- ["media:write", "media:read"],
10
- ["comments:moderate", "comments:read"],
11
- ["redirects:write", "redirects:read"],
12
- ["network:request:unrestricted", "network:request"]
13
- ];
14
- function normalizePluginCapabilities(capabilities) {
15
- const normalized = new Set(normalizeCapabilities(capabilities));
16
- for (const [granted, implied] of PLUGIN_CAPABILITY_IMPLICATIONS) if (normalized.has(granted)) normalized.add(implied);
17
- return [...normalized];
18
- }
19
- const WARNED_DEPRECATED_CAPABILITY_PLUGINS = Symbol.for("emdash:warned-deprecated-capability-plugins");
20
- /**
21
- * Warn, once per plugin per process, that a plugin declares deprecated
22
- * capability names. Call with the plugin's raw, un-normalized capabilities.
23
- */
24
- function warnDeprecatedPluginCapabilities(pluginId, capabilities) {
25
- const deprecated = capabilities.filter(isDeprecatedCapability);
26
- if (deprecated.length === 0) return;
27
- const g = globalThis;
28
- const warned = g[WARNED_DEPRECATED_CAPABILITY_PLUGINS] ??= /* @__PURE__ */ new Set();
29
- if (warned.has(pluginId)) return;
30
- warned.add(pluginId);
31
- const renames = deprecated.map((cap) => `${cap} → ${CAPABILITY_RENAMES[cap]}`).join(", ");
32
- console.warn(`[emdash] Plugin "${pluginId}" declares deprecated capability names (${renames}). They still work, but support will be removed in a future major release. Update the plugin, or ask its author to publish a version that uses the current names.`);
33
- }
34
-
35
- //#endregion
36
- export { normalizePluginCapabilities as a, normalizeCapability as i, isDeprecatedCapability as n, warnDeprecatedPluginCapabilities as o, normalizeCapabilities as r, CAPABILITY_RENAMES as t };
37
- //# sourceMappingURL=types-ClFEExxn.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-ClFEExxn.mjs","names":[],"sources":["../src/plugins/types.ts"],"sourcesContent":["/**\n * Plugin System Types v2\n *\n * New plugin API with:\n * - Single unified context shape for all hooks and routes\n * - Paginated storage queries (no async iterators)\n * - Unified KV API (replaces settings + options)\n * - Explicit ctx.http and ctx.log\n *\n */\n\nimport type { Permission } from \"@emdash-cms/auth\";\nimport type { ConfirmDialog, Element, PluginUiContext } from \"@emdash-cms/blocks\";\n// The plugin capability vocabulary, the legacy-rename map, and the manifest\n// shape are authored once in @emdash-cms/plugin-types and shared between core\n// (the manifest reader at install/runtime) and @emdash-cms/plugin-cli (the\n// manifest writer at bundle/publish time).\n//\n// We import-and-re-export here so existing internal callers keep working\n// (e.g. `import { PluginCapability } from \"../plugins/types.js\"`).\nimport {\n\tCAPABILITY_RENAMES,\n\tcapabilitiesToDeclaredAccess,\n\tdeclaredAccessToCapabilities,\n\tisDeprecatedCapability,\n\tnormalizeCapabilities,\n\tnormalizeCapability,\n\ttype CurrentPluginCapability,\n\ttype DeclaredAccess,\n\ttype DeprecatedPluginCapability,\n\ttype ManifestHookEntry,\n\ttype ManifestMcpTool,\n\ttype ManifestRouteEntry,\n\ttype PluginMcpManifestConfig,\n\ttype PluginCapability,\n\ttype PluginEditorDraftAccess,\n\ttype PluginEditorDraftFieldSelector,\n\ttype PluginFormData,\n\ttype PluginRouteBodyMode,\n\ttype PluginRouteQuery,\n\ttype PluginRouteRequest,\n\ttype PluginStorageConfig,\n\ttype RouteOptions,\n\ttype StorageCollectionConfig,\n} from \"@emdash-cms/plugin-types\";\nimport type { JSX } from \"astro/jsx-runtime\";\nimport type { z } from \"astro/zod\";\n// =============================================================================\n// Core Types\n// =============================================================================\n\nimport type { ContentFieldFilters } from \"../content-list-query.js\";\nimport type { FieldType, FieldValidation, FieldWidgetOptions } from \"../schema/types.js\";\n\nexport type {\n\tContentFieldFilterScalar,\n\tContentFieldFilterValue,\n\tContentFieldFilters,\n\tContentFieldInFilter,\n\tContentFieldRangeFilter,\n} from \"../content-list-query.js\";\n\nexport {\n\tCAPABILITY_RENAMES,\n\tcapabilitiesToDeclaredAccess,\n\tdeclaredAccessToCapabilities,\n\tisDeprecatedCapability,\n\tnormalizeCapabilities,\n\tnormalizeCapability,\n\ttype CurrentPluginCapability,\n\ttype DeclaredAccess,\n\ttype DeprecatedPluginCapability,\n\ttype ManifestHookEntry,\n\ttype ManifestMcpTool,\n\ttype ManifestRouteEntry,\n\ttype PluginMcpManifestConfig,\n\ttype PluginCapability,\n\ttype PluginEditorDraftAccess,\n\ttype PluginEditorDraftFieldSelector,\n\ttype PluginStorageConfig,\n\ttype StorageCollectionConfig,\n};\n\nexport const PLUGIN_CAPABILITY_IMPLICATIONS: ReadonlyArray<\n\treadonly [PluginCapability, PluginCapability]\n> = [\n\t[\"content:write\", \"content:read\"],\n\t[\"content:revisions:read\", \"content:read\"],\n\t[\"taxonomies:write\", \"taxonomies:read\"],\n\t[\"content:publish\", \"content:read\"],\n\t[\"media:write\", \"media:read\"],\n\t[\"comments:moderate\", \"comments:read\"],\n\t[\"redirects:write\", \"redirects:read\"],\n\t[\"network:request:unrestricted\", \"network:request\"],\n];\n\nexport function normalizePluginCapabilities(\n\tcapabilities: readonly PluginCapability[],\n): PluginCapability[];\nexport function normalizePluginCapabilities(capabilities: readonly string[]): string[];\nexport function normalizePluginCapabilities(capabilities: readonly string[]): string[] {\n\tconst normalized = new Set(normalizeCapabilities(capabilities));\n\tfor (const [granted, implied] of PLUGIN_CAPABILITY_IMPLICATIONS) {\n\t\tif (normalized.has(granted)) normalized.add(implied);\n\t}\n\treturn [...normalized];\n}\n\nconst WARNED_DEPRECATED_CAPABILITY_PLUGINS = Symbol.for(\n\t\"emdash:warned-deprecated-capability-plugins\",\n);\n\n/**\n * Warn, once per plugin per process, that a plugin declares deprecated\n * capability names. Call with the plugin's raw, un-normalized capabilities.\n */\nexport function warnDeprecatedPluginCapabilities(\n\tpluginId: string,\n\tcapabilities: readonly string[],\n): void {\n\tconst deprecated = capabilities.filter(isDeprecatedCapability);\n\tif (deprecated.length === 0) return;\n\n\tconst g = globalThis as Record<symbol, unknown>;\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern (see request-context.ts)\n\tconst warned = (g[WARNED_DEPRECATED_CAPABILITY_PLUGINS] ??= new Set<string>()) as Set<string>;\n\tif (warned.has(pluginId)) return;\n\twarned.add(pluginId);\n\n\tconst renames = deprecated.map((cap) => `${cap} → ${CAPABILITY_RENAMES[cap]}`).join(\", \");\n\tconsole.warn(\n\t\t`[emdash] Plugin \"${pluginId}\" declares deprecated capability names (${renames}). ` +\n\t\t\t\"They still work, but support will be removed in a future major release. \" +\n\t\t\t\"Update the plugin, or ask its author to publish a version that uses the current names.\",\n\t);\n}\n\n// =============================================================================\n// Storage Types\n// =============================================================================\n//\n// `StorageCollectionConfig` and `PluginStorageConfig` are re-exported above\n// from `@emdash-cms/plugin-types`. The manifest carries these shapes\n// verbatim; both this package (reader) and plugin-cli (writer) agree on\n// the same types via the shared package.\n\n/**\n * Query filter operators\n */\nexport interface RangeFilter {\n\tgt?: number | string;\n\tgte?: number | string;\n\tlt?: number | string;\n\tlte?: number | string;\n}\n\nexport interface InFilter {\n\tin: Array<string | number>;\n}\n\nexport interface StartsWithFilter {\n\tstartsWith: string;\n}\n\n/**\n * Where clause value types\n */\nexport type WhereValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| RangeFilter\n\t| InFilter\n\t| StartsWithFilter;\n\n/**\n * Where clause for storage queries\n */\nexport type WhereClause = Record<string, WhereValue>;\n\n/**\n * Query options for storage.query()\n */\nexport interface QueryOptions {\n\twhere?: WhereClause;\n\torderBy?: Record<string, \"asc\" | \"desc\">;\n\t/** Default 50, max 100 */\n\tlimit?: number;\n\tcursor?: string;\n}\n\n/**\n * Paginated result (used by storage.query, content.list, media.list)\n */\nexport interface PaginatedResult<T> {\n\titems: T[];\n\tcursor?: string;\n\thasMore: boolean;\n}\n\nexport interface VersionedValue<T = unknown> {\n\tvalue: T;\n\t/** Opaque host revision, valid only for the key from which it was read. */\n\trevision: string;\n}\n\nexport type ConditionalWriteResult = { applied: true; revision: string } | { applied: false };\n\nexport interface ConditionalDeleteResult {\n\tapplied: boolean;\n}\n\n/**\n * A single per-field integer delta for {@link StorageCollection.updateIf}.\n *\n * `inc`/`dec` values must be safe integers, enforced at runtime with\n * `Number.isSafeInteger` (which also rejects `NaN`/`Infinity`), because a TS\n * `number` cannot forbid float literals. Deltas are applied entirely in-SQL\n * over the stored value with `COALESCE(<value>, 0) ± n`, so a delta on a\n * missing or JSON-`null` field starts from `0` (never corrupts the document).\n *\n * `updateIf` does NOT clamp: a `dec` can drive a field negative when the\n * `where` guard doesn't cover the delta magnitude (e.g. stock `2` with\n * `where: { stock: { gte: 1 } }` and `delta: { stock: { dec: 3 } }` → `-1`,\n * `applied: true`). The guard is the caller's responsibility — pair a `dec: k`\n * with a `gte: k` guard to prevent underflow.\n */\nexport type NumericDelta = { inc: number } | { dec: number };\n\n/**\n * Arguments to {@link StorageCollection.updateIf}.\n *\n * `where` reuses the {@link QueryOptions} `WhereClause` verbatim — the guard is\n * evaluated in-SQL with the same numeric-correct, total comparisons as\n * `query()`. An empty `where: {}` emits no guard, i.e. it matches the row\n * unconditionally (update-if-row-exists) — a footgun in the no-oversell case,\n * where a real predicate (e.g. `{ stock: { gte: 1 } }`) is what you want.\n *\n * At least one of `set` / `delta` must be present (a runtime error is thrown\n * otherwise). A field may not appear in both `set` and `delta` in the same\n * call. `set` and `delta` are separate arguments (not a union) so a wholesale\n * value that happens to look like `{ inc: 5 }` is never mistaken for a delta.\n */\nexport interface UpdateIfArgs<T> {\n\t/**\n\t * Guard evaluated in-SQL; identical semantics to `query({ where })`. An\n\t * empty `{}` means \"match the row unconditionally (no guard)\".\n\t */\n\twhere: WhereClause;\n\t/** Wholesale field values merged into the stored JSON document. */\n\tset?: Partial<T>;\n\t/** Per-field integer deltas applied in-SQL (`COALESCE(base, 0) ± n`). */\n\tdelta?: { [K in keyof T]?: NumericDelta };\n}\n\n/**\n * Result of {@link StorageCollection.updateIf}.\n *\n * `applied: false` intentionally conflates \"row absent\" and \"guard failed\": a\n * single-statement guarded `UPDATE` cannot distinguish them, and the caller\n * should not need to. `updateIf` is update-only — it never inserts a missing\n * row.\n */\nexport type UpdateIfResult<T> = { applied: true; data: T } | { applied: false };\n\n/**\n * Storage collection interface - the API exposed to plugins\n * No async iterators - all operations return promises with pagination\n */\nexport interface StorageCollection<T = unknown> {\n\t// Basic CRUD\n\tget(id: string): Promise<T | null>;\n\tput(id: string, data: T): Promise<void>;\n\tdelete(id: string): Promise<boolean>;\n\texists(id: string): Promise<boolean>;\n\t/** A stored JSON null returns an envelope with value: null; only an absent row returns null. */\n\tgetVersioned(id: string): Promise<VersionedValue<T> | null>;\n\t/** A null expected revision creates only when absent. Errors reject; conflicts return applied: false. */\n\tcompareAndSet(\n\t\tid: string,\n\t\texpectedRevision: string | null,\n\t\tdata: T,\n\t): Promise<ConditionalWriteResult>;\n\tcompareAndDelete(id: string, expectedRevision: string): Promise<ConditionalDeleteResult>;\n\n\t// Batch operations\n\tgetMany(ids: string[]): Promise<Map<string, T>>;\n\tputMany(items: Array<{ id: string; data: T }>): Promise<void>;\n\tdeleteMany(ids: string[]): Promise<number>;\n\n\t// Query - always paginated\n\tquery(options?: QueryOptions): Promise<PaginatedResult<{ id: string; data: T }>>;\n\tcount(where?: WhereClause): Promise<number>;\n\n\t// Conditional write (single-statement, atomic per row).\n\t/**\n\t * Predicate-guarded atomic update. Applies `set`/`delta` to the row `id`\n\t * only if it exists and the `where` guard matches, in a single guarded\n\t * `UPDATE … RETURNING`. This is the no-oversell primitive: the guard and the\n\t * arithmetic live in one statement, so N concurrent guarded decrements\n\t * serialize correctly. `applied: false` means the row was absent OR the\n\t * guard failed (the two are intentionally indistinguishable). Non-object\n\t * documents, invalid counters and unsafe arithmetic results also fail the\n\t * guard. Never inserts.\n\t *\n\t * Serialization failures and deadlocks throw `StorageSerializationError`.\n\t * Retry the write with a bounded policy; restart an explicit transaction\n\t * before retrying its operations.\n\t */\n\tupdateIf(id: string, args: UpdateIfArgs<T>): Promise<UpdateIfResult<T>>;\n}\n\n/**\n * Plugin storage context - typed based on declared collections\n */\nexport type PluginStorage<T extends PluginStorageConfig> = {\n\t[K in keyof T]: StorageCollection;\n};\n\n// =============================================================================\n// Context APIs\n// =============================================================================\n\n/**\n * Plugin-scoped key-value state.\n *\n * Convention:\n * - `state:*` - Internal plugin state (not shown to users)\n * - `cache:*` - Reusable computed or remote data\n *\n * The `settings:*` namespace remains a compatibility alias through EmDash\n * 0.x. New code uses `PluginContext.settings` for user configuration.\n */\nexport interface KVAccess {\n\tget<T>(key: string): Promise<T | null>;\n\tgetVersioned<T>(key: string): Promise<VersionedValue<T> | null>;\n\t/** A null expected revision creates only when absent. Errors reject; conflicts return applied: false. */\n\tcompareAndSet(\n\t\tkey: string,\n\t\texpectedRevision: string | null,\n\t\tvalue: unknown,\n\t): Promise<ConditionalWriteResult>;\n\tcompareAndDelete(key: string, expectedRevision: string): Promise<ConditionalDeleteResult>;\n\tset(key: string, value: unknown): Promise<void>;\n\tdelete(key: string): Promise<boolean>;\n\tlist(prefix?: string): Promise<Array<{ key: string; value: unknown }>>;\n}\n\n/** Plugin settings. Fields declared as `secret` in `admin.settingsSchema` are encrypted. */\nexport interface SettingsAccess {\n\tget<T>(key: string): Promise<T | null>;\n\tgetVersioned<T>(key: string): Promise<VersionedValue<T> | null>;\n\tcompareAndSet(\n\t\tkey: string,\n\t\texpectedRevision: string | null,\n\t\tvalue: unknown,\n\t): Promise<ConditionalWriteResult>;\n\tcompareAndDelete(key: string, expectedRevision: string): Promise<ConditionalDeleteResult>;\n\tset(key: string, value: unknown): Promise<void>;\n\tdelete(key: string): Promise<boolean>;\n\tlist(prefix?: string): Promise<Array<{ key: string; value: unknown }>>;\n}\n\n/**\n * SEO metadata for a content item, as stored in the core SEO panel.\n *\n * Only present on items in collections with `has_seo = 1`. For collections\n * without SEO enabled, `ContentItem.seo` is `undefined`.\n */\nexport interface ContentItemSeo {\n\ttitle: string | null;\n\tdescription: string | null;\n\timage: string | null;\n\tcanonical: string | null;\n\tnoIndex: boolean;\n}\n\n/**\n * SEO input accepted by content write operations.\n *\n * All fields are optional — only fields that are present overwrite existing\n * values. An empty object is treated as a no-op.\n */\nexport interface ContentItemSeoInput {\n\ttitle?: string | null;\n\tdescription?: string | null;\n\timage?: string | null;\n\tcanonical?: string | null;\n\tnoIndex?: boolean;\n}\n\n/**\n * Content item returned from content API\n */\nexport interface ContentItem {\n\tid: string;\n\ttype: string;\n\tslug: string | null;\n\tstatus: string;\n\tlocale: string | null;\n\tdata: Record<string, unknown>;\n\t/**\n\t * SEO metadata, populated when the collection has SEO enabled\n\t * (`has_seo = 1`). `undefined` for non-SEO collections.\n\t */\n\tseo?: ContentItemSeo;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tpublishedAt: string | null;\n\t/** Scheduled publication time, if set (e.g. scheduled items or scheduled draft changes). */\n\tscheduledAt?: string | null;\n\tauthorId?: string | null;\n\ttranslationGroup?: string | null;\n\tliveRevisionId?: string | null;\n\tdraftRevisionId?: string | null;\n\tversion?: number;\n}\n\nexport interface ContentTranslationSummary {\n\tid: string;\n\tlocale: string | null;\n\tslug: string | null;\n\tstatus: string;\n\tupdatedAt: string;\n}\n\nexport interface ContentRevisionInfo {\n\tid: string;\n\tcollection: string;\n\tentryId: string;\n\tdata: Record<string, unknown>;\n\tcreatedAt: string;\n}\n\nexport interface FieldSchemaInfo {\n\tslug: string;\n\tlabel: string;\n\ttype: FieldType;\n\trequired: boolean;\n\tunique: boolean;\n\tdefault?: unknown;\n\tvalidation?: FieldValidation;\n\twidget?: string;\n\toptions?: FieldWidgetOptions;\n\tsearchable: boolean;\n\tindexed: boolean;\n\ttranslatable: boolean;\n\tsortOrder: number;\n}\n\nexport interface CollectionSchemaInfo {\n\tslug: string;\n\tlabel: string;\n\tlabelSingular: string | null;\n\tdescription: string | null;\n\tsupports: string[];\n\thasSeo: boolean;\n\ttitleField: string | null;\n\tdateField: string | null;\n\turlPattern: string | null;\n\troutable: boolean;\n\thidden: boolean;\n\tfields: FieldSchemaInfo[];\n}\n\nexport interface SchemaAccess {\n\tlistCollections(): Promise<CollectionSchemaInfo[]>;\n\tgetCollection(slug: string): Promise<CollectionSchemaInfo | null>;\n}\n\nexport interface ContentListWhere {\n\t/** Exact match on `status` (e.g. `\"published\"`, `\"draft\"`). */\n\tstatus?: string;\n\t/** Exact match on `locale` (e.g. `\"en\"`, `\"fr-CA\"`). */\n\tlocale?: string;\n\t/** AND-combined filters over custom fields explicitly marked as indexed. */\n\tfieldFilters?: ContentFieldFilters;\n}\n\n/**\n * Content list options\n */\nexport interface ContentListOptions {\n\tlimit?: number;\n\tcursor?: string;\n\torderBy?: Record<string, \"asc\" | \"desc\">;\n\twhere?: ContentListWhere;\n}\n\n/**\n * Input accepted by `content.create` / `content.update`.\n *\n * Most entries are field slugs mapped to their values. The reserved `seo`\n * key is extracted and routed to the core SEO panel (the `_emdash_seo`\n * table), matching the shape accepted by the REST API. Passing `seo` for a\n * collection that does not have SEO enabled throws a validation error.\n */\nexport type ContentWriteInput = Record<string, unknown> & {\n\tseo?: ContentItemSeoInput;\n};\n\n/** Options accepted by `content.create`. */\nexport interface ContentCreateOptions {\n\t/** Locale for the new content row. Defaults to the configured site locale, then `en`. */\n\tlocale?: string;\n\t/** Existing row in the same collection whose translation group the new row joins. */\n\ttranslationOf?: string;\n}\n\nexport type PluginContentCreateCallback = (\n\tpluginId: string,\n\tcollection: string,\n\tdata: ContentWriteInput,\n\toptions?: ContentCreateOptions & {\n\t\t/** Save-hook origin supplied by sandbox transports to prevent hook re-entry. */\n\t\toriginHook?: \"content:beforeSave\" | \"content:afterSave\";\n\t\tsandboxOrigin?: true;\n\t},\n) => Promise<ContentItem>;\n\n/**\n * Taxonomy definition returned from the taxonomy API (e.g. \"category\", \"tag\").\n */\nexport interface TaxonomyDefInfo {\n\tname: string;\n\tlabel: string;\n\tlabelSingular: string | null;\n\thierarchical: boolean;\n\t/** Collections this taxonomy is attached to (e.g. `[\"posts\"]`). */\n\tcollections: string[];\n\tlocale: string;\n}\n\n/**\n * Taxonomy term returned from the taxonomy API. Flat shape — for hierarchical\n * taxonomies the tree is reconstructed via `parentId` (which stores the\n * parent's locale-agnostic `translationGroup`).\n */\nexport interface TaxonomyTermInfo {\n\tid: string;\n\t/** Taxonomy name this term belongs to (e.g. \"category\"). */\n\ttaxonomy: string;\n\tslug: string;\n\tlabel: string;\n\tparentId: string | null;\n\t/** Term metadata as edited in the admin (`description` etc.). */\n\tdata: Record<string, unknown> | null;\n\tlocale: string;\n\ttranslationGroup: string | null;\n}\n\n/**\n * Options accepted by taxonomy read operations. Omitting `locale` returns\n * rows for every locale.\n */\nexport interface TaxonomyReadOptions {\n\tlocale?: string;\n}\n\nexport interface TaxonomyTermCreateInput {\n\tlabel: string;\n\tslug?: string;\n\tparentId?: string | null;\n\tdescription?: string;\n\tlocale?: string;\n\ttranslationOf?: string;\n}\n\n/**\n * Content access interface - capability-gated\n */\nexport interface ContentAccess {\n\t// Read operations (requires read:content)\n\tget(collection: string, id: string): Promise<ContentItem | null>;\n\tlist(collection: string, options?: ContentListOptions): Promise<PaginatedResult<ContentItem>>;\n\tgetTranslations?(\n\t\tcollection: string,\n\t\tid: string,\n\t): Promise<{ translationGroup: string; translations: ContentTranslationSummary[] }>;\n\tgetPublicUrl?(collection: string, id: string): Promise<string | null>;\n\tlistRevisions?(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions?: { limit?: number },\n\t): Promise<ContentRevisionInfo[]>;\n\tgetRevision?(\n\t\tcollection: string,\n\t\tid: string,\n\t\trevisionId: string,\n\t): Promise<ContentRevisionInfo | null>;\n\n\t// Write operations (requires write:content) - optional on interface\n\tcreate?(\n\t\tcollection: string,\n\t\tdata: ContentWriteInput,\n\t\toptions?: ContentCreateOptions,\n\t): Promise<ContentItem>;\n\tupdate?(collection: string, id: string, data: ContentWriteInput): Promise<ContentItem>;\n\tdelete?(collection: string, id: string): Promise<boolean>;\n\tgetVersioned?(collection: string, id: string): Promise<VersionedContentItem | null>;\n\tpublish?(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions: { _rev: string },\n\t): Promise<VersionedContentItem>;\n\tunpublish?(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions: { _rev: string },\n\t): Promise<VersionedContentItem>;\n\tschedule?(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions: { scheduledAt: string; _rev: string },\n\t): Promise<VersionedContentItem>;\n\tunschedule?(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions: { _rev: string },\n\t): Promise<VersionedContentItem>;\n\tgetTrashedVersioned?(collection: string, id: string): Promise<VersionedContentItem | null>;\n\trestore?(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions: { _rev: string },\n\t): Promise<VersionedContentItem>;\n}\n\nexport interface VersionedContentItem {\n\titem: ContentItem;\n\t_rev: string;\n}\n\nexport interface ContentPublicationAccess extends ContentAccess {\n\tgetVersioned(collection: string, id: string): Promise<VersionedContentItem | null>;\n\tpublish(collection: string, id: string, options: { _rev: string }): Promise<VersionedContentItem>;\n\tunpublish(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions: { _rev: string },\n\t): Promise<VersionedContentItem>;\n\tschedule(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions: { scheduledAt: string; _rev: string },\n\t): Promise<VersionedContentItem>;\n\tunschedule(\n\t\tcollection: string,\n\t\tid: string,\n\t\toptions: { _rev: string },\n\t): Promise<VersionedContentItem>;\n}\n\nexport interface ContentRestoreAccess {\n\tgetTrashedVersioned(collection: string, id: string): Promise<VersionedContentItem | null>;\n\trestore(collection: string, id: string, options: { _rev: string }): Promise<VersionedContentItem>;\n}\n\n/**\n * Taxonomy access interface — capability-gated on `taxonomies:read`.\n */\nexport interface TaxonomyAccess {\n\t/** List taxonomy definitions. */\n\tgetAll(options?: TaxonomyReadOptions): Promise<TaxonomyDefInfo[]>;\n\t/** All terms of a taxonomy, ordered by label. */\n\tgetTerms(taxonomy: string, options?: TaxonomyReadOptions): Promise<TaxonomyTermInfo[]>;\n\t/** Terms assigned to a content entry, optionally scoped to one taxonomy. */\n\tgetEntryTerms(\n\t\tcollection: string,\n\t\tentryId: string,\n\t\toptions?: TaxonomyReadOptions & { taxonomy?: string },\n\t): Promise<TaxonomyTermInfo[]>;\n\tcreateTerm?(taxonomy: string, input: TaxonomyTermCreateInput): Promise<TaxonomyTermInfo>;\n\taddEntryTerms?(\n\t\tcollection: string,\n\t\tentryId: string,\n\t\ttaxonomy: string,\n\t\ttermIds: string[],\n\t): Promise<TaxonomyTermInfo[]>;\n\tremoveEntryTerms?(\n\t\tcollection: string,\n\t\tentryId: string,\n\t\ttaxonomy: string,\n\t\ttermIds: string[],\n\t): Promise<TaxonomyTermInfo[]>;\n}\n\n/** Taxonomy mutations available with `taxonomies:write`. */\nexport interface TaxonomyAccessWithWrite extends TaxonomyAccess {\n\tcreateTerm(taxonomy: string, input: TaxonomyTermCreateInput): Promise<TaxonomyTermInfo>;\n\taddEntryTerms(\n\t\tcollection: string,\n\t\tentryId: string,\n\t\ttaxonomy: string,\n\t\ttermIds: string[],\n\t): Promise<TaxonomyTermInfo[]>;\n\tremoveEntryTerms(\n\t\tcollection: string,\n\t\tentryId: string,\n\t\ttaxonomy: string,\n\t\ttermIds: string[],\n\t): Promise<TaxonomyTermInfo[]>;\n}\n\n/**\n * Public byline profile returned from the byline API. Omits the linked user\n * account, guest flag, and custom field values.\n */\nexport interface BylineInfo {\n\tid: string;\n\tslug: string;\n\tdisplayName: string;\n\tbio: string | null;\n\twebsiteUrl: string | null;\n\t/** Media ID of the avatar image. Resolve it with `ctx.media.get()`. */\n\tavatarMediaId: string | null;\n\tlocale: string;\n\t/** Locale-agnostic identity shared by every translation of the byline. */\n\ttranslationGroup: string;\n}\n\n/** A byline credited on a content entry. */\nexport interface BylineCreditInfo {\n\tbyline: BylineInfo;\n\tsortOrder: number;\n\troleLabel: string | null;\n\t/**\n\t * `explicit` for a credit assigned in the editor; `inferred` when the entry\n\t * has no credits and the byline linked to the entry's author is used.\n\t */\n\tsource: \"explicit\" | \"inferred\";\n}\n\nexport interface BylineListOptions {\n\t/** Match one locale. Omit to list every locale. */\n\tlocale?: string;\n\t/** Page size, clamped to 1–100. Defaults to 50. */\n\tlimit?: number;\n\tcursor?: string;\n}\n\n/** Byline credits for one entry in a batched lookup. */\nexport interface EntryBylineCredits {\n\tentryId: string;\n\tbylines: BylineCreditInfo[];\n}\n\n/**\n * Byline access interface — capability-gated on `bylines:read`.\n */\nexport interface BylineAccess {\n\t/** Get a byline by its row ID. */\n\tget(id: string): Promise<BylineInfo | null>;\n\t/** List bylines, newest first. */\n\tlist(options?: BylineListOptions): Promise<PaginatedResult<BylineInfo>>;\n\t/**\n\t * Bylines credited on up to 100 entries of one collection, in the order the\n\t * IDs were given. Duplicate IDs are returned once. Credits resolve at each\n\t * entry's own locale, matching what the site renders. Trashed and missing\n\t * entries have no credits.\n\t */\n\tgetEntriesBylines(collection: string, entryIds: string[]): Promise<EntryBylineCredits[]>;\n}\n\nexport type RedirectStatus = 301 | 302 | 307 | 308 | 410 | 451;\n\nexport interface RedirectInfo {\n\tid: string;\n\tsource: string;\n\tdestination: string;\n\ttype: RedirectStatus;\n\tisPattern: boolean;\n\tenabled: boolean;\n\thits: number;\n\tlastHitAt: string | null;\n\tgroupName: string | null;\n\tauto: boolean;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface VersionedRedirect {\n\tredirect: RedirectInfo;\n\t/** Opaque host revision. Pass it back unchanged for update or delete. */\n\t_rev: string;\n}\n\nexport interface RedirectListOptions {\n\tlimit?: number;\n\tcursor?: string;\n\tsearch?: string;\n\tgroup?: string;\n\tenabled?: boolean;\n\tauto?: boolean;\n}\n\nexport interface RedirectCreateInput {\n\tsource: string;\n\tdestination?: string;\n\ttype?: RedirectStatus;\n\tenabled?: boolean;\n\tgroupName?: string | null;\n}\n\nexport interface RedirectUpdateInput {\n\tsource?: string;\n\tdestination?: string;\n\ttype?: RedirectStatus;\n\tenabled?: boolean;\n\tgroupName?: string | null;\n}\n\nexport interface RedirectAccess {\n\tlist(options?: RedirectListOptions): Promise<PaginatedResult<RedirectInfo>>;\n\tget(id: string): Promise<VersionedRedirect | null>;\n\tcreate?(input: RedirectCreateInput): Promise<VersionedRedirect>;\n\tupdate?(id: string, input: RedirectUpdateInput & { _rev: string }): Promise<VersionedRedirect>;\n\tdelete?(id: string, options: { _rev: string }): Promise<boolean>;\n}\n\nexport interface RedirectAccessWithWrite extends RedirectAccess {\n\tcreate(input: RedirectCreateInput): Promise<VersionedRedirect>;\n\tupdate(id: string, input: RedirectUpdateInput & { _rev: string }): Promise<VersionedRedirect>;\n\tdelete(id: string, options: { _rev: string }): Promise<boolean>;\n}\n\n/**\n * Full content access with write operations\n */\nexport interface ContentAccessWithWrite extends ContentAccess {\n\tcreate(\n\t\tcollection: string,\n\t\tdata: ContentWriteInput,\n\t\toptions?: ContentCreateOptions,\n\t): Promise<ContentItem>;\n\tupdate(collection: string, id: string, data: ContentWriteInput): Promise<ContentItem>;\n\tdelete(collection: string, id: string): Promise<boolean>;\n}\n\n/**\n * Media item returned from media API\n */\nexport interface MediaItem {\n\tid: string;\n\tfilename: string;\n\tmimeType: string;\n\tsize: number | null;\n\turl: string;\n\tcreatedAt: string;\n\twidth?: number | null;\n\theight?: number | null;\n\talt?: string | null;\n\tcaption?: string | null;\n\tfocalX?: number | null;\n\tfocalY?: number | null;\n\tblurhash?: string | null;\n\tdominantColor?: string | null;\n\tfolderId?: string | null;\n\tstatus?: \"ready\";\n}\n\nexport interface MediaBytes {\n\tbytes: Uint8Array;\n\tfilename: string;\n\tmimeType: string;\n\tsize: number;\n\tcontentHash?: string;\n}\n\nexport interface MediaMetadataPatch {\n\talt?: string | null;\n\tcaption?: string | null;\n\tfocalX?: number | null;\n\tfocalY?: number | null;\n}\n\n/**\n * Media list options\n */\nexport interface MediaListOptions {\n\tlimit?: number;\n\tcursor?: string;\n\tmimeType?: string; // Filter by mime type prefix, e.g., \"image/\"\n}\n\n/**\n * Media access interface - capability-gated\n */\nexport interface MediaAccess {\n\t// Read operations (requires read:media)\n\tget(id: string): Promise<MediaItem | null>;\n\tlist(options?: MediaListOptions): Promise<PaginatedResult<MediaItem>>;\n\t/** Read ready media bytes, bounded by the caller's limit and the host maximum. */\n\treadBytes?(id: string, options?: { maxBytes?: number }): Promise<MediaBytes>;\n\t/** Change only alt text, caption, or the complete focal-point pair. */\n\tupdateMetadata?(id: string, patch: MediaMetadataPatch): Promise<MediaItem>;\n\n\t// Write operations (requires write:media) - optional on interface\n\tgetUploadUrl?(\n\t\tfilename: string,\n\t\tcontentType: string,\n\t): Promise<{ uploadUrl: string; mediaId: string }>;\n\t/**\n\t * Upload media bytes directly. Preferred in sandboxed mode where\n\t * plugins cannot make external requests to a presigned URL.\n\t * Returns the created media item.\n\t */\n\tupload?(\n\t\tfilename: string,\n\t\tcontentType: string,\n\t\tbytes: ArrayBuffer,\n\t): Promise<{ mediaId: string; storageKey: string; url: string }>;\n\tdelete?(id: string): Promise<boolean>;\n}\n\n/**\n * Full media access with write operations\n */\nexport interface MediaAccessWithWrite extends MediaAccess {\n\tgetUploadUrl(\n\t\tfilename: string,\n\t\tcontentType: string,\n\t): Promise<{ uploadUrl: string; mediaId: string }>;\n\tupload(\n\t\tfilename: string,\n\t\tcontentType: string,\n\t\tbytes: ArrayBuffer,\n\t): Promise<{ mediaId: string; storageKey: string; url: string }>;\n\tdelete(id: string): Promise<boolean>;\n}\n\n/**\n * HTTP client interface - requires network:request capability\n */\nexport interface HttpAccess {\n\t/**\n\t * Fetch an allowed external URL and return a buffered response.\n\t * Decoded request and response bodies are each limited to 8 MiB.\n\t */\n\tfetch(url: string, init?: RequestInit): Promise<Response>;\n}\n\n/**\n * Logger interface - always available\n */\nexport interface LogAccess {\n\tdebug(message: string, data?: unknown): void;\n\tinfo(message: string, data?: unknown): void;\n\twarn(message: string, data?: unknown): void;\n\terror(message: string, data?: unknown): void;\n}\n\n// =============================================================================\n// Site & User Access\n// =============================================================================\n\n/**\n * Site information available to all plugins\n */\nexport interface SiteInfo {\n\t/** Site name (from settings) */\n\tname: string;\n\t/** Site URL (from settings or request) */\n\turl: string;\n\t/** Site locale (from settings, defaults to \"en\") */\n\tlocale: string;\n\t/**\n\t * Astro's `trailingSlash` routing policy, from the host's Astro config.\n\t * Plugins that build absolute URLs (sitemap, canonical, hreflang) should\n\t * honor this so the URLs they emit match what the site serves. `createSiteInfo`\n\t * always populates it (defaulting to `\"ignore\"`, Astro's default); it is\n\t * optional on the type so pre-existing `SiteInfo` construction stays valid.\n\t */\n\ttrailingSlash?: \"always\" | \"never\" | \"ignore\";\n}\n\n/**\n * Read-only user information exposed to plugins.\n * Sensitive fields (password hashes, sessions, passkeys) are excluded.\n */\nexport interface UserInfo {\n\tid: string;\n\temail: string;\n\tname: string | null;\n\trole: number;\n\tcreatedAt: string;\n}\n\n/**\n * User access interface - requires read:users capability\n */\nexport interface UserAccess {\n\t/** Get a user by ID */\n\tget(id: string): Promise<UserInfo | null>;\n\t/** Get a user by email */\n\tgetByEmail(email: string): Promise<UserInfo | null>;\n\t/** List users with optional filters */\n\tlist(opts?: { role?: number; limit?: number; cursor?: string }): Promise<{\n\t\titems: UserInfo[];\n\t\tnextCursor?: string;\n\t}>;\n}\n\nexport type PluginCommentStatus = \"approved\" | \"pending\" | \"spam\";\n\n/** Comment data exposed by the explicit personal-data `comments:read` capability. */\nexport interface PluginComment {\n\tid: string;\n\tcollection: string;\n\tcontentId: string;\n\tparentId: string | null;\n\tauthorName: string;\n\tauthorEmail: string;\n\tbody: string;\n\tstatus: PluginCommentStatus;\n\tipHash: string | null;\n\tuserAgent: string | null;\n\tmoderationMetadata: Record<string, unknown> | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface CommentListOptions {\n\tstatus?: PluginCommentStatus;\n\tcollection?: string;\n\tcontentId?: string;\n\tlimit?: number;\n\tcursor?: string;\n}\n\nexport interface CommentCountOptions {\n\tstatus?: PluginCommentStatus;\n\tcollection?: string;\n\tcontentId?: string;\n}\n\nexport interface CommentAccess {\n\tget(id: string): Promise<PluginComment | null>;\n\tlist(options?: CommentListOptions): Promise<PaginatedResult<PluginComment>>;\n\tcount(options?: CommentCountOptions): Promise<number>;\n\tsetStatus?(\n\t\tid: string,\n\t\tstatus: PluginCommentStatus,\n\t\toptions: { expectedStatus: PluginCommentStatus },\n\t): Promise<PluginComment>;\n}\n\n// =============================================================================\n// Plugin Context\n// =============================================================================\n\n/**\n * The unified plugin context - same shape for all hooks and routes\n */\nexport interface PluginContext<TStorage extends PluginStorageConfig = PluginStorageConfig> {\n\t/** Plugin metadata */\n\tplugin: {\n\t\tid: string;\n\t\tversion: string;\n\t};\n\n\t/** Storage collections - only if plugin declares storage */\n\tstorage: PluginStorage<TStorage>;\n\n\t/** Key-value store for internal state */\n\tkv: KVAccess;\n\n\t/** Plugin settings. Secret schema fields are encrypted by the host. */\n\tsettings: SettingsAccess;\n\n\t/** Content access - only if read:content or write:content capability */\n\tcontent?: ContentAccess | ContentAccessWithWrite;\n\t/** Schema discovery - only if schema:read capability */\n\tschema?: SchemaAccess;\n\n\t/** Taxonomy access - only if a taxonomy capability is declared. */\n\ttaxonomies?: TaxonomyAccess | TaxonomyAccessWithWrite;\n\n\t/** Byline access - only if bylines:read capability */\n\tbylines?: BylineAccess;\n\n\t/** Redirect access - only if redirects:read or redirects:write capability */\n\tredirects?: RedirectAccess | RedirectAccessWithWrite;\n\n\t/** Media access - only if read:media or write:media capability */\n\tmedia?: MediaAccess | MediaAccessWithWrite;\n\n\t/** HTTP client - only if network:request capability */\n\thttp?: HttpAccess;\n\n\t/** Logger - always available */\n\tlog: LogAccess;\n\n\t/** Site information - always available */\n\tsite: SiteInfo;\n\n\t/** URL helper - generates absolute URLs from paths. Always available. */\n\turl(path: string): string;\n\n\t/** User access - only if read:users capability */\n\tusers?: UserAccess;\n\n\t/** Comment access — only if comments:read or comments:moderate is declared. */\n\tcomments?: CommentAccess;\n\n\t/** Cron task scheduling - always available, scoped to plugin */\n\tcron?: CronAccess;\n\n\t/** Email access - only if email:send capability and a provider is configured */\n\temail?: EmailAccess;\n}\n\n// =============================================================================\n// Cron Types\n// =============================================================================\n\n/**\n * Cron access interface �� always available on plugin context, scoped to plugin.\n */\nexport interface CronAccess {\n\t/** Schedule a recurring or one-shot task */\n\tschedule(name: string, opts: { schedule: string; data?: Record<string, unknown> }): Promise<void>;\n\t/** Cancel a scheduled task */\n\tcancel(name: string): Promise<void>;\n\t/** List this plugin's scheduled tasks */\n\tlist(): Promise<CronTaskInfo[]>;\n}\n\n/**\n * Task info returned from CronAccess.list()\n */\nexport interface CronTaskInfo {\n\tname: string;\n\tschedule: string;\n\tnextRunAt: string;\n\tlastRunAt: string | null;\n}\n\n/**\n * Event passed to the `cron` hook handler\n */\nexport interface CronEvent {\n\tname: string;\n\tdata?: Record<string, unknown>;\n\tscheduledAt: string;\n}\n\n/**\n * Cron hook handler type\n */\nexport type CronHandler = (event: CronEvent, ctx: PluginContext) => Promise<void>;\n\n// =============================================================================\n// Email Types\n// =============================================================================\n\n/**\n * Email access interface — requires `email:send` capability.\n * Undefined when no `email:deliver` provider is configured.\n *\n * Related capabilities:\n * - `email:send` — grants ctx.email (this interface)\n * - `email:provide` — allows registering the `email:deliver` exclusive hook\n * - `email:intercept` — allows registering `email:beforeSend` / `email:afterSend` hooks\n */\nexport interface EmailAccess {\n\tsend(message: EmailMessage): Promise<void>;\n}\n\n/**\n * Email message shape\n */\nexport interface EmailMessage {\n\tto: string;\n\t/** Additional visible recipients. */\n\tcc?: string[];\n\t/** Address that replies go to instead of the sender. */\n\treplyTo?: string;\n\tsubject: string;\n\ttext: string;\n\thtml?: string;\n}\n\n/**\n * Event passed to email:beforeSend hooks (middleware — transform, validate, cancel)\n */\nexport interface EmailBeforeSendEvent {\n\tmessage: EmailMessage;\n\t/** Where the email originated — \"system\" for auth emails, plugin ID for plugin emails */\n\tsource: string;\n}\n\n/**\n * Event passed to email:deliver hook (exclusive — exactly one provider delivers)\n */\nexport interface EmailDeliverEvent {\n\tmessage: EmailMessage;\n\tsource: string;\n}\n\n/**\n * Event passed to email:afterSend hooks (logging, analytics, fire-and-forget)\n */\nexport interface EmailAfterSendEvent {\n\tmessage: EmailMessage;\n\tsource: string;\n}\n\n/**\n * Handler type for email:beforeSend hooks.\n * Returns modified message, or false to cancel delivery.\n */\nexport type EmailBeforeSendHandler = (\n\tevent: EmailBeforeSendEvent,\n\tctx: PluginContext,\n) => Promise<EmailMessage | false>;\n\n/**\n * Handler type for email:deliver hooks (exclusive provider).\n */\nexport type EmailDeliverHandler = (event: EmailDeliverEvent, ctx: PluginContext) => Promise<void>;\n\n/**\n * Handler type for email:afterSend hooks (fire-and-forget).\n */\nexport type EmailAfterSendHandler = (\n\tevent: EmailAfterSendEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\n// =============================================================================\n// Comment Types\n// =============================================================================\n\n/**\n * Collection comment settings (read from _emdash_collections)\n */\nexport interface CollectionCommentSettings {\n\tcommentsEnabled: boolean;\n\tcommentsModeration: \"all\" | \"first_time\" | \"none\";\n\tcommentsClosedAfterDays: number;\n\tcommentsAutoApproveUsers: boolean;\n}\n\n/**\n * Event passed to comment:beforeCreate hooks (middleware — transform, enrich, reject)\n */\nexport interface CommentBeforeCreateEvent {\n\tcomment: {\n\t\tcollection: string;\n\t\tcontentId: string;\n\t\tparentId: string | null;\n\t\tauthorName: string;\n\t\tauthorEmail: string;\n\t\tauthorUserId: string | null;\n\t\tbody: string;\n\t\tipHash: string | null;\n\t\tuserAgent: string | null;\n\t};\n\t/** Metadata bag — plugins can attach signals for the moderator */\n\tmetadata: Record<string, unknown>;\n}\n\n/**\n * Event passed to comment:moderate hook (exclusive — decides initial status)\n */\nexport interface CommentModerateEvent {\n\tcomment: CommentBeforeCreateEvent[\"comment\"];\n\tmetadata: Record<string, unknown>;\n\tcollectionSettings: CollectionCommentSettings;\n\t/** Number of prior approved comments from this email address */\n\tpriorApprovedCount: number;\n}\n\n/**\n * Moderation decision returned by the comment:moderate handler\n */\nexport interface ModerationDecision {\n\tstatus: \"approved\" | \"pending\" | \"spam\";\n\t/** Optional reason for admin visibility */\n\treason?: string;\n}\n\n/**\n * Stored comment shape (full record with id, status, timestamps)\n */\nexport interface StoredComment {\n\tid: string;\n\tcollection: string;\n\tcontentId: string;\n\tparentId: string | null;\n\tauthorName: string;\n\tauthorEmail: string;\n\tauthorUserId: string | null;\n\tbody: string;\n\tstatus: string;\n\tmoderationMetadata: Record<string, unknown> | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\n/**\n * Event passed to comment:afterCreate hooks (fire-and-forget)\n */\nexport interface CommentAfterCreateEvent {\n\tcomment: StoredComment;\n\tmetadata: Record<string, unknown>;\n\t/** The content item the comment is on */\n\tcontent: { id: string; collection: string; slug: string; title?: string };\n\t/** The content author (for notifications) */\n\tcontentAuthor?: { id: string; name: string | null; email: string };\n}\n\n/**\n * Event passed to comment:afterModerate hooks (fire-and-forget, admin status change)\n */\nexport interface CommentAfterModerateEvent {\n\tcomment: StoredComment;\n\tpreviousStatus: string;\n\tnewStatus: string;\n\t/** The admin who moderated */\n\tmoderator: { id: string; name: string | null };\n\t/** Identifies whether an administrator or a plugin initiated the transition. */\n\torigin?: { source: \"admin\"; userId: string } | { source: \"plugin\"; pluginId: string };\n}\n\n/**\n * Handler type for comment:beforeCreate hooks.\n * Returns modified event, or false to reject the comment.\n */\nexport type CommentBeforeCreateHandler = (\n\tevent: CommentBeforeCreateEvent,\n\tctx: PluginContext,\n) => Promise<CommentBeforeCreateEvent | false | void>;\n\n/**\n * Handler type for comment:moderate hook (exclusive provider).\n */\nexport type CommentModerateHandler = (\n\tevent: CommentModerateEvent,\n\tctx: PluginContext,\n) => Promise<ModerationDecision>;\n\n/**\n * Handler type for comment:afterCreate hooks (fire-and-forget).\n */\nexport type CommentAfterCreateHandler = (\n\tevent: CommentAfterCreateEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\n/**\n * Handler type for comment:afterModerate hooks (fire-and-forget).\n */\nexport type CommentAfterModerateHandler = (\n\tevent: CommentAfterModerateEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\n// =============================================================================\n// Hook Types\n// =============================================================================\n\n/**\n * Hook configuration\n */\nexport interface HookConfig<THandler> {\n\t/** Explicit ordering - lower numbers run first (default: 100) */\n\tpriority?: number;\n\t/** Max execution time in ms (default: 5000) */\n\ttimeout?: number;\n\t/** Run after these plugins */\n\tdependencies?: string[];\n\t/** Error handling policy */\n\terrorPolicy?: \"continue\" | \"abort\";\n\t/**\n\t * Mark this hook as exclusive — only one plugin can be the active provider.\n\t * Exclusive hooks skip the priority pipeline and dispatch only to the\n\t * admin-selected provider. Used for email:deliver, search, image optimization, etc.\n\t */\n\texclusive?: boolean;\n\t/** The hook handler */\n\thandler: THandler;\n}\n\n/**\n * Acting user that triggered a content hook. Present for authenticated\n * saves; absent for unauthenticated or internal writes.\n */\nexport interface ActorInfo {\n\treadonly id: string;\n\treadonly role: number;\n\treadonly source?: \"api\" | \"mcp\" | \"visual-editor\";\n}\n\nexport type ContentActionOrigin =\n\t| { source: \"api\" | \"mcp\" | \"visual-editor\" }\n\t| { source: \"plugin\"; pluginId: string }\n\t| { source: \"scheduler\" }\n\t| { source: \"system\" };\n\nexport type ContentPolicyDecision = void | { cancel: true; reason: string };\n\n/**\n * Content hook event\n */\nexport interface ContentHookEvent {\n\tcontent: Record<string, unknown>;\n\tcollection: string;\n\tisNew: boolean;\n\t/**\n\t * ID of the existing item on `content:beforeSave` for an update. Absent on\n\t * creates, where the ID is assigned when the save completes, and on\n\t * `content:afterSave`, where `content.id` carries it.\n\t */\n\tid?: string;\n\t/**\n\t * The acting user for this save. Carries the same authenticated identity\n\t * used to set the revision author, so plugins (e.g. audit logs) can record\n\t * who made the change.\n\t */\n\tactor?: ActorInfo;\n}\n\n/**\n * Content delete hook event\n */\nexport interface ContentDeleteEvent {\n\tid: string;\n\tcollection: string;\n\t/** `true` when the content is permanently deleted (not just trashed). */\n\tpermanent: boolean;\n}\n\n/**\n * Content state-change hook event (fired after publish, unpublish, restore,\n * schedule, or unschedule).\n */\nexport interface ContentStateChangeEvent {\n\tcontent: Record<string, unknown>;\n\tcollection: string;\n}\n\n/**\n * Content publish/unpublish hook event.\n */\nexport type ContentPublishStateChangeEvent = ContentStateChangeEvent;\n\n/**\n * Content restore hook event.\n */\nexport type ContentRestoreStateChangeEvent = ContentStateChangeEvent;\n\n/**\n * Content schedule/unschedule hook event.\n */\nexport type ContentScheduleStateChangeEvent = ContentStateChangeEvent;\n\nexport interface ContentPolicyEvent extends ContentStateChangeEvent {\n\torigin: ContentActionOrigin;\n\tactor?: ActorInfo;\n}\n\nexport interface ContentSchedulePolicyEvent extends ContentPolicyEvent {\n\tscheduledAt: string;\n}\n\n/**\n * Media hook event\n */\nexport interface MediaUploadEvent {\n\tfile: { name: string; type: string; size: number };\n}\n\n/**\n * Media after upload event\n */\nexport interface MediaAfterUploadEvent {\n\tmedia: MediaItem;\n}\n\n/**\n * Lifecycle hook event\n */\nexport interface LifecycleEvent {\n\t// Empty for install/activate/deactivate\n}\n\n/**\n * Uninstall hook event\n */\nexport interface UninstallEvent {\n\tdeleteData: boolean;\n}\n\n// Hook handler types - all receive (event, ctx) with unified context\nexport type ContentBeforeSaveHandler = (\n\tevent: ContentHookEvent,\n\tctx: PluginContext,\n) => Promise<Record<string, unknown> | void>;\n\nexport type ContentAfterSaveHandler = (\n\tevent: ContentHookEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type ContentBeforeDeleteHandler = (\n\tevent: ContentDeleteEvent,\n\tctx: PluginContext,\n) => Promise<boolean | void>;\n\nexport type ContentAfterDeleteHandler = (\n\tevent: ContentDeleteEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type ContentBeforePublishHandler = (\n\tevent: ContentPolicyEvent,\n\tctx: PluginContext,\n) => Promise<ContentPolicyDecision>;\n\nexport type ContentBeforeScheduleHandler = (\n\tevent: ContentSchedulePolicyEvent,\n\tctx: PluginContext,\n) => Promise<ContentPolicyDecision>;\n\nexport type ContentBeforeUnpublishHandler = (\n\tevent: ContentPolicyEvent,\n\tctx: PluginContext,\n) => Promise<ContentPolicyDecision>;\n\nexport type ContentAfterPublishHandler = (\n\tevent: ContentPublishStateChangeEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type ContentAfterUnpublishHandler = (\n\tevent: ContentPublishStateChangeEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type ContentAfterRestoreHandler = (\n\tevent: ContentRestoreStateChangeEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type ContentAfterScheduleHandler = (\n\tevent: ContentScheduleStateChangeEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type ContentAfterUnscheduleHandler = (\n\tevent: ContentScheduleStateChangeEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\n/**\n * Event for `byline:afterSave`, fired after a byline profile or one of its\n * locale translations is created or updated.\n */\nexport interface BylineAfterSaveEvent {\n\tbyline: BylineInfo;\n\tisNew: boolean;\n}\n\n/**\n * Event for `byline:afterDelete`, fired after a byline row is deleted. When it\n * was the last locale of its translation group, its credits have already been\n * removed from every entry.\n */\nexport interface BylineAfterDeleteEvent {\n\tbyline: BylineInfo;\n}\n\nexport type BylineAfterSaveHandler = (\n\tevent: BylineAfterSaveEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type BylineAfterDeleteHandler = (\n\tevent: BylineAfterDeleteEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type MediaBeforeUploadHandler = (\n\tevent: MediaUploadEvent,\n\tctx: PluginContext,\n) => Promise<{ name: string; type: string; size: number } | void>;\n\nexport type MediaAfterUploadHandler = (\n\tevent: MediaAfterUploadEvent,\n\tctx: PluginContext,\n) => Promise<void>;\n\nexport type LifecycleHandler = (event: LifecycleEvent, ctx: PluginContext) => Promise<void>;\n\nexport type UninstallHandler = (event: UninstallEvent, ctx: PluginContext) => Promise<void>;\n\n// =============================================================================\n// Public Page Contribution Types\n// =============================================================================\n\n/** Placement targets for page fragment contributions */\nexport type PagePlacement = \"head\" | \"body:start\" | \"body:end\";\n\n/**\n * A single breadcrumb trail item. Used by `PublicPageContext.breadcrumbs`\n * so themes can publish breadcrumb trails that SEO plugins consume.\n */\nexport interface BreadcrumbItem {\n\t/** Display name for this crumb (e.g. \"Home\", \"Blog\", \"My Post\"). */\n\tname: string;\n\t/** Absolute or root-relative URL for this crumb. */\n\turl: string;\n}\n\n/**\n * Describes the page being rendered. Passed to page hooks so plugins\n * can decide what to contribute without fetching content themselves.\n */\nexport interface PublicPageContext {\n\turl: string;\n\tpath: string;\n\tlocale: string | null;\n\tkind: \"content\" | \"custom\";\n\tpageType: string;\n\t/** Full document title for the rendered page */\n\ttitle: string | null;\n\t/** Page-only title for OG/Twitter/JSON-LD headline output */\n\tpageTitle?: string | null;\n\tdescription: string | null;\n\tcanonical: string | null;\n\timage: string | null;\n\tcontent?: {\n\t\tcollection: string;\n\t\tid: string;\n\t\tslug: string | null;\n\t};\n\t/** SEO meta for base metadata generation in EmDashHead */\n\tseo?: {\n\t\togTitle?: string | null;\n\t\togDescription?: string | null;\n\t\togImage?: string | null;\n\t\trobots?: string | null;\n\t};\n\t/** Article metadata for Open Graph article: tags */\n\tarticleMeta?: {\n\t\tpublishedTime?: string | null;\n\t\tmodifiedTime?: string | null;\n\t\tauthor?: string | null;\n\t};\n\t/** Site name for structured data and og:site_name */\n\tsiteName?: string;\n\t/**\n\t * Optional breadcrumb trail for this page, root first. When set,\n\t * SEO plugins should use this verbatim rather than deriving a trail\n\t * from `path`. Themes typically populate this at the point they\n\t * build the context (e.g. from a content hierarchy walk, taxonomy\n\t * lookup, or per-`pageType` routing logic).\n\t *\n\t * Semantics for consumers:\n\t * - `undefined` — theme has no opinion; consumer falls back to\n\t * its own derivation.\n\t * - `[]` — this page has no breadcrumbs (e.g. homepage); consumer\n\t * should skip `BreadcrumbList` emission entirely.\n\t * - Non-empty array — used verbatim for `BreadcrumbList` output.\n\t */\n\tbreadcrumbs?: BreadcrumbItem[];\n\t/** Public-facing site URL (origin) for structured data */\n\tsiteUrl?: string;\n}\n\n// ── page:metadata ───────────────────────────────────────────────\n\nexport interface PageMetadataEvent {\n\tpage: PublicPageContext;\n}\n\n/**\n * Allowed rel values for link contributions.\n * This is a security-critical allowlist -- sandboxed plugins can only inject\n * link tags with these rel values. Adding \"stylesheet\", \"prefetch\", \"prerender\"\n * etc. would allow sandboxed plugins to inject external resources.\n */\nexport type PageMetadataLinkRel =\n\t| \"canonical\"\n\t| \"alternate\"\n\t| \"author\"\n\t| \"license\"\n\t| \"nlweb\"\n\t| \"site.standard.document\";\n\nexport type PageMetadataContribution =\n\t| { kind: \"meta\"; name: string; content: string; key?: string }\n\t| { kind: \"property\"; property: string; content: string; key?: string }\n\t| { kind: \"link\"; rel: PageMetadataLinkRel; href: string; hreflang?: string; key?: string }\n\t| {\n\t\t\tkind: \"jsonld\";\n\t\t\tid?: string;\n\t\t\tgraph: Record<string, unknown> | Array<Record<string, unknown>>;\n\t };\n\nexport type PageMetadataHandler = (\n\tevent: PageMetadataEvent,\n\tctx: PluginContext,\n) =>\n\t| PageMetadataContribution\n\t| PageMetadataContribution[]\n\t| null\n\t| Promise<PageMetadataContribution | PageMetadataContribution[] | null>;\n\n// ── page:fragments (trusted-only) ──────────────────────────────\n\nexport interface PageFragmentEvent {\n\tpage: PublicPageContext;\n}\n\nexport type PageFragmentContribution =\n\t| {\n\t\t\tkind: \"external-script\";\n\t\t\tplacement: PagePlacement;\n\t\t\tsrc: string;\n\t\t\tasync?: boolean;\n\t\t\tdefer?: boolean;\n\t\t\tattributes?: Record<string, string>;\n\t\t\tkey?: string;\n\t }\n\t| {\n\t\t\tkind: \"inline-script\";\n\t\t\tplacement: PagePlacement;\n\t\t\tcode: string;\n\t\t\tattributes?: Record<string, string>;\n\t\t\tkey?: string;\n\t }\n\t| {\n\t\t\tkind: \"html\";\n\t\t\tplacement: PagePlacement;\n\t\t\thtml: string;\n\t\t\tkey?: string;\n\t };\n\nexport type PageFragmentHandler = (\n\tevent: PageFragmentEvent,\n\tctx: PluginContext,\n) =>\n\t| PageFragmentContribution\n\t| PageFragmentContribution[]\n\t| null\n\t| Promise<PageFragmentContribution | PageFragmentContribution[] | null>;\n\n/**\n * Plugin hooks definition\n */\nexport interface PluginHooks {\n\t// Lifecycle hooks\n\t\"plugin:install\"?: HookConfig<LifecycleHandler> | LifecycleHandler;\n\t\"plugin:activate\"?: HookConfig<LifecycleHandler> | LifecycleHandler;\n\t\"plugin:deactivate\"?: HookConfig<LifecycleHandler> | LifecycleHandler;\n\t\"plugin:uninstall\"?: HookConfig<UninstallHandler> | UninstallHandler;\n\n\t// Content hooks\n\t\"content:beforeSave\"?: HookConfig<ContentBeforeSaveHandler> | ContentBeforeSaveHandler;\n\t\"content:afterSave\"?: HookConfig<ContentAfterSaveHandler> | ContentAfterSaveHandler;\n\t\"content:beforeDelete\"?: HookConfig<ContentBeforeDeleteHandler> | ContentBeforeDeleteHandler;\n\t\"content:afterDelete\"?: HookConfig<ContentAfterDeleteHandler> | ContentAfterDeleteHandler;\n\t\"content:beforePublish\"?: HookConfig<ContentBeforePublishHandler> | ContentBeforePublishHandler;\n\t\"content:beforeSchedule\"?:\n\t\t| HookConfig<ContentBeforeScheduleHandler>\n\t\t| ContentBeforeScheduleHandler;\n\t\"content:beforeUnpublish\"?:\n\t\t| HookConfig<ContentBeforeUnpublishHandler>\n\t\t| ContentBeforeUnpublishHandler;\n\t\"content:afterPublish\"?: HookConfig<ContentAfterPublishHandler> | ContentAfterPublishHandler;\n\t\"content:afterUnpublish\"?:\n\t\t| HookConfig<ContentAfterUnpublishHandler>\n\t\t| ContentAfterUnpublishHandler;\n\t\"content:afterRestore\"?: HookConfig<ContentAfterRestoreHandler> | ContentAfterRestoreHandler;\n\t\"content:afterSchedule\"?: HookConfig<ContentAfterScheduleHandler> | ContentAfterScheduleHandler;\n\t\"content:afterUnschedule\"?:\n\t\t| HookConfig<ContentAfterUnscheduleHandler>\n\t\t| ContentAfterUnscheduleHandler;\n\n\t// Media hooks\n\t\"media:beforeUpload\"?: HookConfig<MediaBeforeUploadHandler> | MediaBeforeUploadHandler;\n\t\"media:afterUpload\"?: HookConfig<MediaAfterUploadHandler> | MediaAfterUploadHandler;\n\n\t// Cron hook\n\tcron?: HookConfig<CronHandler> | CronHandler;\n\n\t// Email hooks\n\t\"email:beforeSend\"?: HookConfig<EmailBeforeSendHandler> | EmailBeforeSendHandler;\n\t\"email:deliver\"?: HookConfig<EmailDeliverHandler> | EmailDeliverHandler;\n\t\"email:afterSend\"?: HookConfig<EmailAfterSendHandler> | EmailAfterSendHandler;\n\n\t// Comment hooks\n\t\"comment:beforeCreate\"?: HookConfig<CommentBeforeCreateHandler> | CommentBeforeCreateHandler;\n\t\"comment:moderate\"?: HookConfig<CommentModerateHandler> | CommentModerateHandler;\n\t\"comment:afterCreate\"?: HookConfig<CommentAfterCreateHandler> | CommentAfterCreateHandler;\n\t\"comment:afterModerate\"?: HookConfig<CommentAfterModerateHandler> | CommentAfterModerateHandler;\n\t\"byline:afterSave\"?: HookConfig<BylineAfterSaveHandler> | BylineAfterSaveHandler;\n\t\"byline:afterDelete\"?: HookConfig<BylineAfterDeleteHandler> | BylineAfterDeleteHandler;\n\n\t// Public page hooks\n\t\"page:metadata\"?: HookConfig<PageMetadataHandler> | PageMetadataHandler;\n\t\"page:fragments\"?: HookConfig<PageFragmentHandler> | PageFragmentHandler;\n}\n\n/**\n * Hook names\n */\n/**\n * Hook name in a manifest. Core's exhaustive union of recognised hook names,\n * derived from the `PluginHooks` registry. The serialised manifest carries\n * these as opaque strings; this stricter type is only used for type-checking\n * inside core. `ManifestHookEntry` is re-exported from\n * `@emdash-cms/plugin-types` near the top of this file.\n */\nexport type HookName = keyof PluginHooks;\n\n/**\n * Resolved hook with normalized config\n */\nexport interface ResolvedHook<THandler> {\n\tpriority: number;\n\ttimeout: number;\n\tdependencies: string[];\n\terrorPolicy: \"continue\" | \"abort\";\n\t/** Whether this hook is exclusive (provider pattern) */\n\texclusive: boolean;\n\thandler: THandler;\n\tpluginId: string;\n}\n\n// =============================================================================\n// Request Metadata Types\n// =============================================================================\n\n/**\n * Geographic location information derived from the request.\n * Available when running on Cloudflare Workers (via the `cf` object).\n */\nexport interface GeoInfo {\n\tcountry: string | null;\n\tregion: string | null;\n\tcity: string | null;\n}\n\n/**\n * Normalized request metadata available to plugin route handlers.\n * Extracted from request headers and platform-specific properties.\n */\nexport interface RequestMeta {\n\tip: string | null;\n\tuserAgent: string | null;\n\treferer: string | null;\n\tgeo: GeoInfo | null;\n}\n\n// =============================================================================\n// Route Types\n// =============================================================================\n\n/**\n * Route handler context extends plugin context with request-specific data\n */\nexport interface RouteContext<TInput = unknown> extends PluginContext {\n\t/** Validated input from request body */\n\tinput: TInput;\n\t/** Original request */\n\trequest: Request;\n\t/** Normalized request metadata (IP, user agent, geo) */\n\trequestMeta: RequestMeta;\n\t/** Host-attested context for a validated Block Kit request. */\n\tui?: PluginUiContext;\n\t/**\n\t * Authenticated caller, if the route is private. The host has already\n\t * authenticated and authorized this user before dispatch, so the value\n\t * is trustworthy — unlike a user id read from the request body.\n\t *\n\t * `undefined` for public routes (which skip auth entirely) and for\n\t * token-authed requests where no user is bound to the token.\n\t *\n\t * Not gated by the `users:read` capability: this is the caller's own\n\t * identity for the current request, not a user directory lookup.\n\t */\n\tuser?: UserInfo;\n}\n\n/**\n * Route definition\n */\nexport interface PluginRoute<TInput = unknown> extends Omit<RouteOptions, \"request\"> {\n\t/** Zod schema for input validation */\n\tinput?: z.ZodType<TInput>;\n\t/**\n\t * Mark this route as publicly accessible (no authentication required).\n\t * Public routes skip session/token auth and CSRF checks.\n\t */\n\tpublic?: boolean;\n\t/** RBAC permission required to invoke the route. Legacy routes default to plugins:manage. */\n\tpermission?: Permission;\n\t/**\n\t * `Cache-Control` header value for successful GET responses, e.g.\n\t * `\"public, max-age=60, stale-while-revalidate=300\"`. Only honored on\n\t * routes that are also `public: true` — authenticated responses always\n\t * keep the default `private, no-store`. Errors are never cached.\n\t */\n\tcacheControl?: string;\n\t/** Bounded request parsing and incoming-header declaration. */\n\trequest?: PluginRouteRequest;\n\t/** Route handler */\n\thandler: { bivarianceHack(ctx: RouteContext<TInput>): Promise<unknown> }[\"bivarianceHack\"];\n}\n\nexport type PluginRouteInput<TMode extends PluginRouteBodyMode> = TMode extends \"none\"\n\t? PluginRouteQuery\n\t: TMode extends \"text\"\n\t\t? string\n\t\t: TMode extends \"bytes\"\n\t\t\t? Uint8Array\n\t\t\t: TMode extends \"form-data\"\n\t\t\t\t? PluginFormData\n\t\t\t\t: unknown;\n\nexport type PluginRouteDefinition<TMode extends PluginRouteBodyMode = PluginRouteBodyMode> = Omit<\n\tPluginRoute<PluginRouteInput<TMode>>,\n\t\"request\"\n> & {\n\trequest: PluginRouteRequest & { body: TMode };\n};\n\nexport interface PluginMcpToolDefinition {\n\tdescription: string;\n\troute: string;\n\tinput: z.ZodType;\n\toutput?: z.ZodType;\n\tdestructive?: boolean;\n}\n\nexport interface PluginMcpConfig {\n\ttools: Record<string, PluginMcpToolDefinition>;\n}\n\n// =============================================================================\n// Plugin Definition\n// =============================================================================\n\n/**\n * Admin page definition\n */\nexport interface PluginAdminPage {\n\tpath: string;\n\tlabel: string;\n\ticon?: string;\n}\n\n/**\n * Dashboard widget definition\n */\nexport interface PluginDashboardWidget {\n\tid: string;\n\tsize?: \"full\" | \"half\" | \"third\";\n\ttitle?: string;\n}\n\nexport interface PluginEditorPanel {\n\tid: string;\n\ttitle: string;\n\troute: string;\n\tcollections?: string[];\n\torder?: number;\n\tdraft?: PluginEditorDraftAccess;\n}\n\nexport interface PluginEditorAction {\n\tid: string;\n\tlabel: string;\n\troute: string;\n\tplacement: \"toolbar\" | \"overflow\";\n\tcollections?: string[];\n\tstyle?: \"default\" | \"danger\";\n\tconfirm?: ConfirmDialog;\n\tdraft?: PluginEditorDraftAccess;\n}\n\n/**\n * Settings field types (for admin UI generation)\n */\nexport type SettingFieldType =\n\t| \"string\"\n\t| \"number\"\n\t| \"boolean\"\n\t| \"select\"\n\t| \"secret\"\n\t| \"url\"\n\t| \"email\";\n\nexport interface BaseSettingField {\n\ttype: SettingFieldType;\n\tlabel: string;\n\tdescription?: string;\n}\n\nexport interface StringSettingField extends BaseSettingField {\n\ttype: \"string\";\n\tdefault?: string;\n\tmultiline?: boolean;\n}\n\nexport interface NumberSettingField extends BaseSettingField {\n\ttype: \"number\";\n\tdefault?: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface BooleanSettingField extends BaseSettingField {\n\ttype: \"boolean\";\n\tdefault?: boolean;\n}\n\nexport interface SelectSettingField extends BaseSettingField {\n\ttype: \"select\";\n\toptions: Array<{ value: string; label: string }>;\n\tdefault?: string;\n}\n\nexport interface SecretSettingField extends BaseSettingField {\n\ttype: \"secret\";\n}\n\nexport interface UrlSettingField extends BaseSettingField {\n\ttype: \"url\";\n\tdefault?: string;\n\tplaceholder?: string;\n}\n\nexport interface EmailSettingField extends BaseSettingField {\n\ttype: \"email\";\n\tdefault?: string;\n\tplaceholder?: string;\n}\n\nexport type SettingField =\n\t| StringSettingField\n\t| NumberSettingField\n\t| BooleanSettingField\n\t| SelectSettingField\n\t| SecretSettingField\n\t| UrlSettingField\n\t| EmailSettingField;\n\n/**\n * Block Kit element for block editing fields.\n * This is the `Element` discriminated union from `@emdash-cms/blocks`.\n * Plugin authors should use `@emdash-cms/blocks` builder functions to create these.\n */\nexport type PortableTextBlockField = Element;\n\n/**\n * Configuration for a Portable Text block type contributed by a plugin\n */\nexport interface PortableTextBlockConfig {\n\t/** Block type name (must match the `_type` in Portable Text) */\n\ttype: string;\n\t/** Human-readable label shown in slash commands and modals */\n\tlabel: string;\n\t/** Icon key (e.g., \"video\", \"code\", \"link\", \"link-external\") */\n\ticon?: string;\n\t/** Description shown in slash command menu */\n\tdescription?: string;\n\t/** Placeholder text for the URL input */\n\tplaceholder?: string;\n\t/** Block Kit form fields for the editing UI. If declared, replaces the simple URL input. */\n\tfields?: PortableTextBlockField[];\n\t/**\n\t * Optional. Display category in the slash menu. Defaults to \"Embeds\".\n\t *\n\t * Plugin authors should pick a meaningful category that reflects what the\n\t * block actually is — e.g. \"Sections\", \"Marketing\", \"Media\", \"Embeds\",\n\t * \"Layout\". Blocks with the same category are grouped together in the\n\t * editor's slash menu.\n\t */\n\tcategory?: string;\n}\n\n/**\n * Configuration for a field widget type contributed by a plugin.\n * A field widget provides a custom editing UI for a schema field.\n * The field references the widget via `widget: \"pluginId:widgetName\"`.\n */\nexport interface FieldWidgetConfig {\n\t/** Widget name (without plugin ID prefix) */\n\tname: string;\n\t/** Human-readable label for the admin UI */\n\tlabel: string;\n\t/** Which field types this widget can edit (e.g., [\"json\", \"string\"]) */\n\tfieldTypes: FieldType[];\n\t/** Block Kit elements for sandboxed rendering. Omit for trusted plugins using React. */\n\telements?: Element[];\n}\n\n/**\n * Admin configuration\n */\nexport interface PluginAdminConfig {\n\t/** Module specifier for admin UI exports (e.g., \"@emdash-cms/plugin-audit-log/admin\") */\n\tentry?: string;\n\t/** Settings schema for auto-generated UI */\n\tsettingsSchema?: Record<string, SettingField>;\n\t/** Admin pages */\n\tpages?: PluginAdminPage[];\n\t/** Dashboard widgets */\n\twidgets?: PluginDashboardWidget[];\n\t/** Saved-entry Block Kit panels. */\n\teditorPanels?: PluginEditorPanel[];\n\t/** Saved-entry host-rendered actions. */\n\teditorActions?: PluginEditorAction[];\n\t/** Portable Text block types this plugin provides */\n\tportableTextBlocks?: PortableTextBlockConfig[];\n\t/** Field widget types this plugin provides */\n\tfieldWidgets?: FieldWidgetConfig[];\n}\n\n/**\n * Plugin definition - input to definePlugin()\n */\nexport interface PluginDefinition<TStorage extends PluginStorageConfig = PluginStorageConfig> {\n\t/** Unique plugin identifier */\n\tid: string;\n\t/** Plugin version (semver) */\n\tversion: string;\n\n\t/** Declared capabilities */\n\tcapabilities?: PluginCapability[];\n\n\t/** Allowed hosts for network:request (wildcards supported: *.example.com) */\n\tallowedHosts?: string[];\n\n\t/** Storage collections with indexes */\n\tstorage?: TStorage;\n\n\t/** Hooks */\n\thooks?: PluginHooks;\n\n\t/** API routes */\n\troutes?: Record<string, PluginRoute>;\n\n\t/** Routes explicitly exposed as agent-callable MCP tools. */\n\tmcp?: PluginMcpConfig;\n\n\t/** Admin UI configuration */\n\tadmin?: PluginAdminConfig;\n}\n\n/**\n * Resolved plugin - after definePlugin() processing\n */\nexport interface ResolvedPlugin<TStorage extends PluginStorageConfig = PluginStorageConfig> {\n\tid: string;\n\tversion: string;\n\tcapabilities: PluginCapability[];\n\tallowedHosts: string[];\n\tstorage: TStorage;\n\thooks: ResolvedPluginHooks;\n\troutes: Record<string, PluginRoute>;\n\tmcp?: PluginMcpConfig;\n\tadmin: PluginAdminConfig;\n}\n\n/**\n * Resolved hooks with normalized config\n */\nexport interface ResolvedPluginHooks {\n\t\"plugin:install\"?: ResolvedHook<LifecycleHandler>;\n\t\"plugin:activate\"?: ResolvedHook<LifecycleHandler>;\n\t\"plugin:deactivate\"?: ResolvedHook<LifecycleHandler>;\n\t\"plugin:uninstall\"?: ResolvedHook<UninstallHandler>;\n\t\"content:beforeSave\"?: ResolvedHook<ContentBeforeSaveHandler>;\n\t\"content:afterSave\"?: ResolvedHook<ContentAfterSaveHandler>;\n\t\"content:beforeDelete\"?: ResolvedHook<ContentBeforeDeleteHandler>;\n\t\"content:afterDelete\"?: ResolvedHook<ContentAfterDeleteHandler>;\n\t\"content:beforePublish\"?: ResolvedHook<ContentBeforePublishHandler>;\n\t\"content:beforeSchedule\"?: ResolvedHook<ContentBeforeScheduleHandler>;\n\t\"content:beforeUnpublish\"?: ResolvedHook<ContentBeforeUnpublishHandler>;\n\t\"content:afterPublish\"?: ResolvedHook<ContentAfterPublishHandler>;\n\t\"content:afterUnpublish\"?: ResolvedHook<ContentAfterUnpublishHandler>;\n\t\"content:afterRestore\"?: ResolvedHook<ContentAfterRestoreHandler>;\n\t\"content:afterSchedule\"?: ResolvedHook<ContentAfterScheduleHandler>;\n\t\"content:afterUnschedule\"?: ResolvedHook<ContentAfterUnscheduleHandler>;\n\t\"media:beforeUpload\"?: ResolvedHook<MediaBeforeUploadHandler>;\n\t\"media:afterUpload\"?: ResolvedHook<MediaAfterUploadHandler>;\n\tcron?: ResolvedHook<CronHandler>;\n\t\"email:beforeSend\"?: ResolvedHook<EmailBeforeSendHandler>;\n\t\"email:deliver\"?: ResolvedHook<EmailDeliverHandler>;\n\t\"email:afterSend\"?: ResolvedHook<EmailAfterSendHandler>;\n\t\"comment:beforeCreate\"?: ResolvedHook<CommentBeforeCreateHandler>;\n\t\"comment:moderate\"?: ResolvedHook<CommentModerateHandler>;\n\t\"comment:afterCreate\"?: ResolvedHook<CommentAfterCreateHandler>;\n\t\"comment:afterModerate\"?: ResolvedHook<CommentAfterModerateHandler>;\n\t\"byline:afterSave\"?: ResolvedHook<BylineAfterSaveHandler>;\n\t\"byline:afterDelete\"?: ResolvedHook<BylineAfterDeleteHandler>;\n\t\"page:metadata\"?: ResolvedHook<PageMetadataHandler>;\n\t\"page:fragments\"?: ResolvedHook<PageFragmentHandler>;\n}\n\n// =============================================================================\n// Plugin Admin Exports\n// =============================================================================\n\n/**\n * What a plugin exports from its /admin entrypoint\n * Uses generic component type to avoid React dependency\n */\nexport interface PluginAdminExports {\n\twidgets?: Record<string, JSX.Element>;\n\tpages?: Record<string, JSX.Element>;\n\tfields?: Record<string, JSX.Element>;\n}\n\n// =============================================================================\n// Sandbox Types\n// =============================================================================\n\n/**\n * Plugin manifest — the metadata portion of a plugin bundle, used for\n * sandboxed plugins loaded from the marketplace.\n *\n * This interface is core's stricter version of the manifest contract: it\n * uses the exhaustive `HookName` union and core's typed `PluginAdminConfig`.\n * The wire-shape lives in `@emdash-cms/plugin-types` as `PluginManifest`\n * with looser types (so the registry CLI can serialise hook names it\n * doesn't know about). Both must stay structurally compatible: every value\n * of this type must be assignable to the shared one. The static assertion\n * below catches any drift at compile time.\n */\nexport interface PluginManifest {\n\tid: string;\n\tversion: string;\n\t/**\n\t * The trust contract (see `@emdash-cms/plugin-types`). Authoritative;\n\t * `capabilities`/`allowedHosts` are derived from it at the parse boundary\n\t * via `reconcileManifestAccess`. Optional during the wire-format migration.\n\t */\n\tdeclaredAccess?: DeclaredAccess;\n\tcapabilities: PluginCapability[];\n\tallowedHosts: string[];\n\tstorage: PluginStorageConfig;\n\t/** Hook declarations — either plain name strings or structured objects */\n\thooks: Array<ManifestHookEntry | HookName>;\n\t/** Route declarations — either plain name strings or structured objects */\n\troutes: Array<ManifestRouteEntry | string>;\n\tmcp?: PluginMcpManifestConfig;\n\tadmin: PluginAdminConfig;\n}\n\n// Type-level guard: core's `PluginManifest` is intentionally a SUBTYPE of\n// the shared wire shape (`@emdash-cms/plugin-types` `PluginManifest`). The\n// wire shape uses looser types like `string` for hook names so the registry\n// CLI can serialise plugins targeting hook versions this core doesn't yet\n// know about. Core narrows `string` to `HookName` and `Record<string,\n// unknown>` to `PluginAdminConfig` because core's loader actually executes\n// against those types.\n//\n// We assert one direction at compile time: `core extends shared`. The\n// reverse direction (`shared extends core`) intentionally does NOT hold\n// because shared is wider -- a manifest written against the wire shape\n// could carry a hook name core doesn't know. That runtime narrowing is the\n// job of `manifest-schema.ts` (zod-validated, called at every JSON.parse\n// of a manifest.json), not of the type system. The static check below\n// catches the OTHER failure mode: core adding a required field or\n// non-assignable type that the wire shape doesn't allow.\n//\n// `type X = never` is itself legal as a type alias, so the assertion has to\n// be in a value position (`const _check: T = true`) for the compiler to\n// error when T resolves to `never`. Don't replace this with a bare type\n// alias.\ntype _AssertManifestCompat =\n\tPluginManifest extends import(\"@emdash-cms/plugin-types\").PluginManifest ? true : never;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst _MANIFEST_COMPAT: _AssertManifestCompat = true;\n"],"mappings":";;;AAmFA,MAAa,iCAET;CACH,CAAC,iBAAiB,eAAe;CACjC,CAAC,0BAA0B,eAAe;CAC1C,CAAC,oBAAoB,kBAAkB;CACvC,CAAC,mBAAmB,eAAe;CACnC,CAAC,eAAe,aAAa;CAC7B,CAAC,qBAAqB,gBAAgB;CACtC,CAAC,mBAAmB,iBAAiB;CACrC,CAAC,gCAAgC,kBAAkB;CACnD;AAMD,SAAgB,4BAA4B,cAA2C;CACtF,MAAM,aAAa,IAAI,IAAI,sBAAsB,aAAa,CAAC;AAC/D,MAAK,MAAM,CAAC,SAAS,YAAY,+BAChC,KAAI,WAAW,IAAI,QAAQ,CAAE,YAAW,IAAI,QAAQ;AAErD,QAAO,CAAC,GAAG,WAAW;;AAGvB,MAAM,uCAAuC,OAAO,IACnD,8CACA;;;;;AAMD,SAAgB,iCACf,UACA,cACO;CACP,MAAM,aAAa,aAAa,OAAO,uBAAuB;AAC9D,KAAI,WAAW,WAAW,EAAG;CAE7B,MAAM,IAAI;CAEV,MAAM,SAAU,EAAE,0DAA0C,IAAI,KAAa;AAC7E,KAAI,OAAO,IAAI,SAAS,CAAE;AAC1B,QAAO,IAAI,SAAS;CAEpB,MAAM,UAAU,WAAW,KAAK,QAAQ,GAAG,IAAI,KAAK,mBAAmB,OAAO,CAAC,KAAK,KAAK;AACzF,SAAQ,KACP,oBAAoB,SAAS,0CAA0C,QAAQ,mKAG/E"}
@@ -1,85 +0,0 @@
1
- //#region src/settings/types.d.ts
2
- /**
3
- * Site Settings Types
4
- *
5
- * Global configuration for the site (title, logo, social links, etc.)
6
- */
7
- /**
8
- * Media reference for logo/favicon/seo.defaultOgImage.
9
- *
10
- * Stored shape is just `{ mediaId, alt? }`. The remaining fields are
11
- * populated by `resolveMediaReference` on read so templates can emit
12
- * correct head tags without a second round-trip to the media table.
13
- *
14
- * The Zod schemas at the REST/MCP boundary are split:
15
- * - `mediaReferenceInput` (used by `settingsUpdateBody`) defines only
16
- * `mediaId` and `alt`. Default strip-mode parsing discards any
17
- * resolved fields a client posts back, so they never reach storage.
18
- * - `mediaReferenceResponse` (used by `siteSettingsSchema`) includes
19
- * the resolved fields so generated OpenAPI clients see them.
20
- *
21
- * If you ever switch `mediaReferenceInput` to `passthrough`, you must
22
- * also strip the resolved fields explicitly in `setSiteSettings`, or
23
- * stored options will accumulate stale `url` / `contentType` / `width`
24
- * / `height` snapshots.
25
- */
26
- interface MediaReference {
27
- mediaId: string;
28
- alt?: string;
29
- /** Resolved URL. Populated by `resolveMediaReference`; absent on raw stored values. */
30
- url?: string;
31
- /** Stored MIME type (e.g. `image/svg+xml`). Populated alongside `url`. */
32
- contentType?: string;
33
- /** Pixel width if known. Populated alongside `url`. */
34
- width?: number;
35
- /** Pixel height if known. Populated alongside `url`. */
36
- height?: number;
37
- }
38
- /** Site-level SEO settings */
39
- interface SeoSettings {
40
- /** Separator between page title and site title (e.g., " | ", " — ") */
41
- titleSeparator?: string;
42
- /** Default OG image when content has no seo_image */
43
- defaultOgImage?: MediaReference;
44
- /** Custom robots.txt content. If unset, a default is generated. */
45
- robotsTxt?: string;
46
- /** Google Search Console verification meta tag content */
47
- googleVerification?: string;
48
- /** Bing Webmaster Tools verification meta tag content */
49
- bingVerification?: string;
50
- }
51
- /** Site settings schema */
52
- interface SiteSettings {
53
- title: string;
54
- tagline?: string;
55
- logo?: MediaReference;
56
- favicon?: MediaReference;
57
- url?: string;
58
- postsPerPage: number;
59
- dateFormat: string;
60
- timezone: string;
61
- social?: {
62
- twitter?: string;
63
- github?: string;
64
- facebook?: string;
65
- instagram?: string;
66
- linkedin?: string;
67
- youtube?: string;
68
- };
69
- seo?: SeoSettings;
70
- }
71
- /** Partial SEO update. `null` removes the configured default image. */
72
- interface SeoSettingsUpdate extends Omit<SeoSettings, "defaultOgImage"> {
73
- defaultOgImage?: MediaReference | null;
74
- }
75
- /** Site-settings write shape. `null` removes media references; omitted fields are unchanged. */
76
- interface SiteSettingsUpdate extends Omit<Partial<SiteSettings>, "logo" | "favicon" | "seo"> {
77
- logo?: MediaReference | null;
78
- favicon?: MediaReference | null;
79
- seo?: SeoSettingsUpdate;
80
- }
81
- /** Keys that are valid site settings */
82
- type SiteSettingKey = keyof SiteSettings;
83
- //#endregion
84
- export { SiteSettings as a, SiteSettingKey as i, SeoSettings as n, SiteSettingsUpdate as o, SeoSettingsUpdate as r, MediaReference as t };
85
- //# sourceMappingURL=types-D994zUWB.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-D994zUWB.d.mts","names":[],"sources":["../src/settings/types.ts"],"mappings":";;AAyBA;;;;;;;;;;;;AAcA;;;;;;;;;;;UAdiB,cAAA;EAChB,OAAA;EACA,GAAA;;EAEA,GAAA;EA6BU;EA3BV,WAAA;EAgDiB;EA9CjB,KAAA;EAsBA;EApBA,MAAA;AAAA;;UAIgB,WAAA;EAmBN;EAjBV,cAAA;EAuBA;EArBA,cAAA,GAAiB,cAAA;EAuBjB;EArBA,SAAA;EAyBC;EAvBD,kBAAA;EAyBC;EAvBD,gBAAA;AAAA;;UAIgB,YAAA;EAEhB,KAAA;EACA,OAAA;EACA,IAAA,GAAO,cAAA;EACP,OAAA,GAAU,cAAA;EAGV,GAAA;EAGA,YAAA;EACA,UAAA;EACA,QAAA;EAGA,MAAA;IACC,OAAA;IACA,MAAA;IACA,QAAA;IACA,SAAA;IACA,QAAA;IACA,OAAA;EAAA;EAID,GAAA,GAAM,WAAA;AAAA;;UAIU,iBAAA,SAA0B,IAAA,CAAK,WAAA;EAC/C,cAAA,GAAiB,cAAA;AAAA;;UAID,kBAAA,SAA2B,IAAA,CAC3C,OAAA,CAAQ,YAAA;EAGR,IAAA,GAAO,cAAA;EACP,OAAA,GAAU,cAAA;EACV,GAAA,GAAM,iBAAA;AAAA;;KAIK,cAAA,SAAuB,YAAA"}
@@ -1,125 +0,0 @@
1
- //#region src/object-cache/types.d.ts
2
- /**
3
- * Object cache types
4
- *
5
- * The object cache is an optional, distributed read-through cache that sits
6
- * *beneath* the per-request cache (`requestCached`) and *above* the database.
7
- * Query results (content entries, settings, menus, taxonomies) are stored in a
8
- * fast key/value store (Cloudflare KV, or an in-isolate memory store for Node)
9
- * so repeat reads across requests and isolates skip the database entirely.
10
- *
11
- * Backends only ever deal in strings — serialization (including `Date`
12
- * preservation) is handled by the core read-through layer in `./codec.ts`, so
13
- * every backend behaves identically.
14
- */
15
- /**
16
- * A pluggable object-cache backend.
17
- *
18
- * Implementations must be safe to call concurrently and should never throw on
19
- * cache misses — `get` returns `null` for a miss. A backend that throws (e.g.
20
- * a transient KV error) degrades gracefully: the read-through layer treats a
21
- * thrown `get` as a miss and a thrown `set` as a no-op, so the database
22
- * remains the source of truth.
23
- */
24
- interface ObjectCacheBackend {
25
- /** Return the stored string for `key`, or `null` on a miss. */
26
- get(key: string): Promise<string | null>;
27
- /**
28
- * Store `value` under `key`.
29
- *
30
- * @param ttlSeconds Optional time-to-live in seconds. Backends that don't
31
- * support TTLs may ignore it, but distributed backends (KV) should honor
32
- * it so orphaned, epoch-busted keys are eventually reclaimed.
33
- */
34
- set(key: string, value: string, ttlSeconds?: number): Promise<void>;
35
- /** Remove `key`. Idempotent — deleting a missing key is not an error. */
36
- delete(key: string): Promise<void>;
37
- }
38
- /**
39
- * Serializable descriptor for an object-cache backend.
40
- *
41
- * Mirrors {@link import("../storage/types.js").StorageDescriptor}: `entrypoint`
42
- * is a module specifier resolved at build time that exports a
43
- * {@link CreateObjectCacheBackendFn} named `createObjectCache`; `config` is the
44
- * plain, serializable runtime config passed to it.
45
- */
46
- interface ObjectCacheDescriptor {
47
- /** Module path exporting a `createObjectCache` function. */
48
- entrypoint: string;
49
- /** Serializable config passed to `createObjectCache` at runtime. */
50
- config: ObjectCacheRuntimeConfig;
51
- }
52
- /**
53
- * Runtime config shared by every backend, plus backend-specific keys.
54
- *
55
- * The read-through layer reads `defaultTtl`, `revalidate`, and `keyPrefix`;
56
- * individual backends read their own keys (e.g. the KV backend reads
57
- * `binding`).
58
- */
59
- interface ObjectCacheRuntimeConfig {
60
- /**
61
- * Default time-to-live for cached entries, in seconds.
62
- *
63
- * Invalidation works by epoch comparison, not key deletion: a stale value
64
- * is detected on read (its stored epoch no longer matches) and overwritten
65
- * in place under the same key. The TTL is just a backstop that reclaims
66
- * keys that are never read again.
67
- *
68
- * @default 3600 (1 hour)
69
- */
70
- defaultTtl?: number;
71
- /**
72
- * How long (milliseconds) an isolate may reuse a cached namespace epoch
73
- * before re-reading it from the backend.
74
- *
75
- * After a write bumps a namespace's epoch, an isolate keeps serving the
76
- * previous epoch's keys until its cached epoch expires after this window. It
77
- * is only part of the cross-isolate staleness: a distributed backend adds its
78
- * own propagation delay (KV's edge cache is eventually consistent, up to
79
- * ~60s), so on KV the effective window is that propagation plus this value.
80
- * Preview and edit requests bypass the cache. Renders that may fill Astro's
81
- * route cache also bypass it, preventing an older KV snapshot from being
82
- * stored as a fresh HTML response after a purge.
83
- *
84
- * Set to `0` to re-read the epoch on every query (strongest freshness, more
85
- * backend reads).
86
- *
87
- * @default 1000
88
- */
89
- revalidate?: number;
90
- /**
91
- * Prefix applied to every cache key. Lets multiple EmDash sites share one
92
- * KV namespace without colliding.
93
- *
94
- * @default "em"
95
- */
96
- keyPrefix?: string;
97
- /**
98
- * Maximum time (milliseconds) to wait for a single backend read before
99
- * treating it as a cache miss and falling back to the database.
100
- *
101
- * Guards against a backend operation that stalls without resolving or
102
- * rejecting (e.g. a cold cross-region KV read, or one queued behind the
103
- * Workers simultaneous-connection limit), which would otherwise hang the
104
- * request. A timed-out read degrades to a miss; the database remains the
105
- * source of truth.
106
- *
107
- * Set to `0` to disable the timeout (not recommended on Cloudflare).
108
- *
109
- * @default 2000
110
- */
111
- timeout?: number;
112
- /** Backend-specific keys (e.g. the KV binding name). */
113
- [key: string]: unknown;
114
- }
115
- /**
116
- * Factory signature exported as `createObjectCache` from a backend entrypoint.
117
- *
118
- * Each backend accesses its own resources directly: the KV backend imports
119
- * bindings from `cloudflare:workers`; the memory backend uses an in-isolate
120
- * map.
121
- */
122
- type CreateObjectCacheBackendFn = (config: ObjectCacheRuntimeConfig) => ObjectCacheBackend;
123
- //#endregion
124
- export { ObjectCacheRuntimeConfig as i, ObjectCacheBackend as n, ObjectCacheDescriptor as r, CreateObjectCacheBackendFn as t };
125
- //# sourceMappingURL=types-DAj1ByJQ.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-DAj1ByJQ.d.mts","names":[],"sources":["../src/object-cache/types.ts"],"mappings":";;AAuBA;;;;;;;;;;;;;;;;;;;;;UAAiB,kBAAA;EAuBqB;EArBrC,GAAA,CAAI,GAAA,WAAc,OAAA;EAyBc;;;;;;AAUjC;EA3BC,GAAA,CAAI,GAAA,UAAa,KAAA,UAAe,UAAA,YAAsB,OAAA;;EAEtD,MAAA,CAAO,GAAA,WAAc,OAAA;AAAA;;;;;;;AAyFtB;;UA9EiB,qBAAA;EA8EgF;EA5EhG,UAAA;EA4EyC;EA1EzC,MAAA,EAAQ,wBAAA;AAAA;;;;;;;;UAUQ,wBAAA;;;;;;;;;;;EAWhB,UAAA;;;;;;;;;;;;;;;;;;;EAmBA,UAAA;;;;;;;EAOA,SAAA;;;;;;;;;;;;;;;EAeA,OAAA;;GAEC,GAAA;AAAA;;;;;;;;KAUU,0BAAA,IAA8B,MAAA,EAAQ,wBAAA,KAA6B,kBAAA"}
@@ -1,77 +0,0 @@
1
- //#region src/plugins/sandbox/types.ts
2
- const SANDBOX_ROUTE_ERROR_DEFINITIONS = {
3
- MEDIA_USAGE_ACTIVATION_IN_PROGRESS: {
4
- message: "Media usage activation is in progress",
5
- status: 503
6
- },
7
- MEDIA_USAGE_ACTIVATION_CHECK_FAILED: {
8
- message: "Unable to verify media usage activation state",
9
- status: 503
10
- },
11
- TRANSFER_IMPORT_IN_PROGRESS: {
12
- message: "A site import is in progress or incomplete; writes are disabled",
13
- status: 503
14
- },
15
- TRANSFER_FENCE_CHECK_FAILED: {
16
- message: "Unable to verify whether site writes are allowed",
17
- status: 503
18
- }
19
- };
20
- function isRecord(value) {
21
- return typeof value === "object" && value !== null;
22
- }
23
- function isSandboxRouteErrorCode(value) {
24
- return typeof value === "string" && value in SANDBOX_ROUTE_ERROR_DEFINITIONS;
25
- }
26
- function getSandboxRouteErrorDetails(error) {
27
- if (!isRecord(error)) return null;
28
- const propertyCode = isSandboxRouteErrorCode(error.code) ? error.code : null;
29
- const nameCode = error instanceof Error && isSandboxRouteErrorCode(error.name) ? error.name : null;
30
- if (propertyCode && nameCode && propertyCode !== nameCode) return null;
31
- const code = propertyCode ?? nameCode;
32
- if (!code || error.status !== void 0 && error.status !== 503) return null;
33
- return {
34
- code,
35
- ...SANDBOX_ROUTE_ERROR_DEFINITIONS[code]
36
- };
37
- }
38
- function createSandboxRouteError(code) {
39
- const details = {
40
- code,
41
- ...SANDBOX_ROUTE_ERROR_DEFINITIONS[code]
42
- };
43
- return Object.assign(new Error(details.message), details, { name: code });
44
- }
45
- function createSandboxRouteErrorEnvelope(error) {
46
- const details = getSandboxRouteErrorDetails(error);
47
- return details ? {
48
- __emdashSandboxRouteError: true,
49
- error: details
50
- } : null;
51
- }
52
- function getSandboxRouteErrorEnvelope(value) {
53
- if (!isRecord(value) || value.__emdashSandboxRouteError !== true) return null;
54
- const details = getSandboxRouteErrorDetails(value.error);
55
- return details ? {
56
- __emdashSandboxRouteError: true,
57
- error: details
58
- } : null;
59
- }
60
- function withUnavailableReason(message, runner) {
61
- const reason = runner?.unavailableReason?.();
62
- return reason ? `${message}: ${reason}` : message;
63
- }
64
- /**
65
- * Error thrown when the sandbox runtime is unavailable.
66
- * This happens when the sidecar process has crashed or hasn't started.
67
- */
68
- var SandboxUnavailableError = class extends Error {
69
- constructor(pluginId, reason) {
70
- super(`Plugin sandbox unavailable for ${pluginId}: ${reason}`);
71
- this.name = "SandboxUnavailableError";
72
- }
73
- };
74
-
75
- //#endregion
76
- export { getSandboxRouteErrorEnvelope as a, getSandboxRouteErrorDetails as i, createSandboxRouteError as n, withUnavailableReason as o, createSandboxRouteErrorEnvelope as r, SandboxUnavailableError as t };
77
- //# sourceMappingURL=types-Dlv6esp4.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-Dlv6esp4.mjs","names":[],"sources":["../src/plugins/sandbox/types.ts"],"sourcesContent":["/**\n * Plugin Sandbox Types\n *\n * Defines interfaces for running plugins in sandboxed V8 isolates.\n * The SandboxRunner interface is implemented by platform adapters\n * (e.g., Cloudflare Worker Loader) to provide isolation.\n *\n */\n\nimport type { PluginUiContext } from \"@emdash-cms/blocks/server\";\nimport type { Kysely } from \"kysely\";\n\nimport type { Database } from \"../../database/types.js\";\nimport type { ContentActionCallbacks } from \"../context.js\";\nimport type {\n\tContentCreateOptions,\n\tContentItem,\n\tContentWriteInput,\n\tPluginComment,\n\tPluginCommentStatus,\n\tPluginManifest,\n\tRequestMeta,\n\tTaxonomyAccessWithWrite,\n\tUserInfo,\n} from \"../types.js\";\n\n/**\n * Resource limits for sandboxed plugins.\n * Enforced by the sandbox runtime (e.g., Worker Loader).\n */\nexport interface ResourceLimits {\n\t/** CPU time per invocation in milliseconds (default: 50ms) */\n\tcpuMs?: number;\n\t/** Memory limit in MB (default: 128MB) */\n\tmemoryMb?: number;\n\t/** Maximum subrequests per invocation (default: 10) */\n\tsubrequests?: number;\n\t/** Wall-clock time limit in milliseconds (default: 30000ms) */\n\twallTimeMs?: number;\n}\n\n/**\n * Storage interface for loading plugin code.\n * Could be R2, local filesystem, or any other storage backend.\n */\nexport interface PluginCodeStorage {\n\t/** Get plugin bundle code by path */\n\tget(path: string): Promise<string | null>;\n\t/** Check if a bundle exists */\n\texists(path: string): Promise<boolean>;\n}\n\n/**\n * Serialized email message for sandbox RPC transport.\n * Matches the core EmailMessage type but uses only serializable fields.\n */\nexport interface SandboxEmailMessage {\n\tto: string;\n\tcc?: string[];\n\treplyTo?: string;\n\tsubject: string;\n\ttext: string;\n\thtml?: string;\n}\n\n/**\n * Callback for sending email from a sandboxed plugin.\n * The sandbox runner wires this up from the EmailPipeline.\n *\n * @param message - The email message to send\n * @param pluginId - The sending plugin's ID (used as source)\n */\nexport type SandboxEmailSendCallback = (\n\tmessage: SandboxEmailMessage,\n\tpluginId: string,\n) => Promise<void>;\n\nexport type SandboxCommentModerateCallback = (\n\tpluginId: string,\n\tid: string,\n\tstatus: PluginCommentStatus,\n\texpectedStatus: PluginCommentStatus,\n) => Promise<PluginComment>;\n\nexport type SandboxContentCreateCallback = (\n\tpluginId: string,\n\tcollection: string,\n\tdata: ContentWriteInput,\n\toptions?: ContentCreateOptions & {\n\t\toriginHook?: \"content:beforeSave\" | \"content:afterSave\";\n\t\tsandboxOrigin?: true;\n\t},\n) => Promise<ContentItem>;\n\nexport type SandboxHttpFetchCallback = typeof fetch;\n\n/**\n * Options for creating a sandbox runner\n */\nexport interface SandboxOptions {\n\t/** Storage interface for loading plugin code */\n\tstorage?: PluginCodeStorage;\n\t/** Database for bridge operations */\n\tdb: Kysely<Database>;\n\t/**\n\t * Called immediately before a sandboxed plugin content mutation; it throws\n\t * to refuse the write. When it returns a function, the bridge calls that\n\t * function once the write has succeeded.\n\t */\n\tbeforeContentWrite?: () => Promise<void | (() => Promise<void>)>;\n\t/** Runtime-owned taxonomy mutation surface used by sandbox bridges. */\n\ttaxonomyWrite?: TaxonomyAccessWithWrite;\n\tcontentActions?: ContentActionCallbacks;\n\t/** Clock used to calculate recurring plugin task schedules. */\n\tnow?: () => Date;\n\t/** Default resource limits */\n\tlimits?: ResourceLimits;\n\t/** Site info for plugin context (injected into wrapper at generation time) */\n\tsiteInfo?: {\n\t\tname: string;\n\t\turl: string;\n\t\tlocale: string;\n\t\ttrailingSlash?: \"always\" | \"never\" | \"ignore\";\n\t};\n\t/** Email send callback, wired from the EmailPipeline by the runtime */\n\temailSend?: SandboxEmailSendCallback;\n\tcommentModerate?: SandboxCommentModerateCallback;\n\t/** Optional host HTTP transport used by test hosts and custom runtimes. */\n\thttpFetch?: SandboxHttpFetchCallback;\n\t/**\n\t * Media storage adapter for sandboxed plugin byte reads, uploads, and deletes.\n\t * Each operation remains gated by its own media capability.\n\t */\n\tmediaStorage?: {\n\t\tupload(options: { key: string; body: Uint8Array; contentType: string }): Promise<unknown>;\n\t\tdownload(key: string): Promise<{\n\t\t\tbody: ReadableStream<Uint8Array>;\n\t\t\tcontentType: string;\n\t\t\tsize: number;\n\t\t}>;\n\t\tdelete(key: string): Promise<unknown>;\n\t};\n\t/** Worker Loader name suffix. The plugin's logical ID remains unchanged. */\n\tisolateKey?: string;\n}\n\n/**\n * Handle to a sandboxed plugin running inside an isolate. Returned\n * by `SandboxRunner.load` and held by the runtime's cache so hooks /\n * routes can be invoked across the isolate boundary. Distinct from\n * the author-facing `SandboxedPlugin` type in `emdash/plugin`, which\n * describes the source-level shape of a plugin's default export.\n */\nexport interface SandboxedPluginInstance {\n\t/** Unique identifier: `${manifest.id}:${manifest.version}` */\n\treadonly id: string;\n\n\t/**\n\t * Invoke a hook in the sandboxed plugin.\n\t *\n\t * @param hookName - Name of the hook (e.g., \"content:beforeSave\")\n\t * @param event - Event data to pass to the hook\n\t * @returns Hook result (transformed content, void, etc.)\n\t */\n\tinvokeHook(hookName: string, event: unknown): Promise<unknown>;\n\n\t/**\n\t * Invoke an API route in the sandboxed plugin.\n\t *\n\t * @param routeName - Name of the route\n\t * @param input - Validated input data\n\t * @param request - Serialized request info for context\n\t * @returns Route response data\n\t */\n\tinvokeRoute(\n\t\trouteName: string,\n\t\tinput: unknown,\n\t\trequest: SerializedRequest,\n\t\toptions?: SandboxInvocationOptions,\n\t): Promise<unknown>;\n\n\t/**\n\t * Change whether the plugin may access host services.\n\t * Deactivation revokes credentials synchronously; reactivation issues fresh credentials.\n\t */\n\tsetActive?(active: boolean): void;\n\n\t/**\n\t * Terminate the sandboxed plugin.\n\t * Releases resources and prevents further invocations.\n\t */\n\tterminate(): Promise<void>;\n}\n\nexport interface SandboxInvocationOptions {\n\tinvalidateContentCache?: (tags: string[]) => Promise<void>;\n}\n\n/**\n * Serialized request for RPC transport.\n * Worker Loader can't pass Request objects directly.\n */\nexport interface SerializedRequest {\n\turl: string;\n\tmethod: string;\n\theaders: Record<string, string>;\n\t/** Normalized request metadata extracted before RPC serialization */\n\tmeta: RequestMeta;\n\t/** Host-attested context for a validated Block Kit request. */\n\tui?: PluginUiContext;\n\t/**\n\t * Authenticated caller for private routes, resolved by the host before\n\t * dispatch. Undefined for public routes and unbound machine tokens.\n\t */\n\tuser?: UserInfo;\n}\n\nconst SANDBOX_ROUTE_ERROR_DEFINITIONS = {\n\tMEDIA_USAGE_ACTIVATION_IN_PROGRESS: {\n\t\tmessage: \"Media usage activation is in progress\",\n\t\tstatus: 503,\n\t},\n\tMEDIA_USAGE_ACTIVATION_CHECK_FAILED: {\n\t\tmessage: \"Unable to verify media usage activation state\",\n\t\tstatus: 503,\n\t},\n\tTRANSFER_IMPORT_IN_PROGRESS: {\n\t\tmessage: \"A site import is in progress or incomplete; writes are disabled\",\n\t\tstatus: 503,\n\t},\n\tTRANSFER_FENCE_CHECK_FAILED: {\n\t\tmessage: \"Unable to verify whether site writes are allowed\",\n\t\tstatus: 503,\n\t},\n} as const;\n\nexport type SandboxRouteErrorCode = keyof typeof SANDBOX_ROUTE_ERROR_DEFINITIONS;\n\nexport interface SandboxRouteErrorDetails {\n\tcode: SandboxRouteErrorCode;\n\tmessage: string;\n\tstatus: 503;\n}\n\nexport interface SandboxRouteErrorEnvelope {\n\t__emdashSandboxRouteError: true;\n\terror: SandboxRouteErrorDetails;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nfunction isSandboxRouteErrorCode(value: unknown): value is SandboxRouteErrorCode {\n\treturn typeof value === \"string\" && value in SANDBOX_ROUTE_ERROR_DEFINITIONS;\n}\n\nexport function getSandboxRouteErrorDetails(error: unknown): SandboxRouteErrorDetails | null {\n\tif (!isRecord(error)) return null;\n\n\tconst propertyCode = isSandboxRouteErrorCode(error.code) ? error.code : null;\n\tconst nameCode =\n\t\terror instanceof Error && isSandboxRouteErrorCode(error.name) ? error.name : null;\n\tif (propertyCode && nameCode && propertyCode !== nameCode) return null;\n\n\tconst code = propertyCode ?? nameCode;\n\tif (!code || (error.status !== undefined && error.status !== 503)) return null;\n\n\treturn {\n\t\tcode,\n\t\t...SANDBOX_ROUTE_ERROR_DEFINITIONS[code],\n\t};\n}\n\nexport function createSandboxRouteError(\n\tcode: SandboxRouteErrorCode,\n): Error & SandboxRouteErrorDetails {\n\tconst details: SandboxRouteErrorDetails = {\n\t\tcode,\n\t\t...SANDBOX_ROUTE_ERROR_DEFINITIONS[code],\n\t};\n\treturn Object.assign(new Error(details.message), details, { name: code });\n}\n\nexport function createSandboxRouteErrorEnvelope(error: unknown): SandboxRouteErrorEnvelope | null {\n\tconst details = getSandboxRouteErrorDetails(error);\n\treturn details ? { __emdashSandboxRouteError: true, error: details } : null;\n}\n\nexport function getSandboxRouteErrorEnvelope(value: unknown): SandboxRouteErrorEnvelope | null {\n\tif (!isRecord(value) || value.__emdashSandboxRouteError !== true) return null;\n\tconst details = getSandboxRouteErrorDetails(value.error);\n\treturn details ? { __emdashSandboxRouteError: true, error: details } : null;\n}\n\n/**\n * Sandbox runner interface.\n * Platform adapters implement this to provide plugin isolation.\n */\nexport interface SandboxRunner {\n\t/**\n\t * Check if sandboxing is available on this platform.\n\t * Returns false for platforms that don't support isolation.\n\t */\n\tisAvailable(): boolean;\n\n\t/**\n\t * Check if the sandbox runtime is currently healthy.\n\t * For in-process runners this always returns true.\n\t * For sidecar-based runners (workerd), returns false if the\n\t * child process has crashed and hasn't been restarted yet.\n\t */\n\tisHealthy(): boolean;\n\n\t/**\n\t * Why the runner cannot run plugins, once isAvailable() or isHealthy()\n\t * has returned false. A lowercase clause without a final period: callers\n\t * append it to their own message after a colon.\n\t *\n\t * Making this required breaks runners implemented outside this repository.\n\t */\n\tunavailableReason?(): string;\n\n\t/**\n\t * Load a sandboxed plugin from code.\n\t *\n\t * @param manifest - Plugin manifest with metadata and capabilities\n\t * @param code - The bundled plugin JavaScript code\n\t * @returns A sandboxed plugin instance\n\t * @throws If sandboxing is not available or plugin can't be loaded\n\t */\n\tload(manifest: PluginManifest, code: string): Promise<SandboxedPluginInstance>;\n\n\t/**\n\t * Set the email send callback for sandboxed plugins.\n\t * Called after the EmailPipeline is created, since the pipeline\n\t * doesn't exist when the sandbox runner is constructed.\n\t */\n\tsetEmailSend(callback: SandboxEmailSendCallback | null): void;\n\tsetCommentModerate?(callback: SandboxCommentModerateCallback | null): void;\n\tsetContentCreate?(callback: SandboxContentCreateCallback | null): void;\n\tsetContentActions?(callback: ContentActionCallbacks | null): void;\n\n\t/** Wake a long-lived scheduler after a sandboxed plugin changes its tasks. */\n\tsetCronReschedule?(callback: (() => void) | null): void;\n\n\t/**\n\t * Terminate all loaded sandboxed plugins.\n\t * Called during shutdown or when reconfiguring.\n\t */\n\tterminateAll(): Promise<void>;\n}\n\nexport function withUnavailableReason(message: string, runner: SandboxRunner | null): string {\n\tconst reason = runner?.unavailableReason?.();\n\treturn reason ? `${message}: ${reason}` : message;\n}\n\n/**\n * Error thrown when the sandbox runtime is unavailable.\n * This happens when the sidecar process has crashed or hasn't started.\n */\nexport class SandboxUnavailableError extends Error {\n\tconstructor(pluginId: string, reason: string) {\n\t\tsuper(`Plugin sandbox unavailable for ${pluginId}: ${reason}`);\n\t\tthis.name = \"SandboxUnavailableError\";\n\t}\n}\n\n/**\n * Factory function type for creating sandbox runners.\n * Exported by platform adapters (e.g., @emdash-cms/cloudflare/sandbox).\n *\n * @example\n * ```typescript\n * // In @emdash-cms/cloudflare/sandbox\n * export const createSandboxRunner: SandboxRunnerFactory = (options) => {\n * return new CloudflareSandboxRunner(options);\n * };\n * ```\n */\nexport type SandboxRunnerFactory = (options: SandboxOptions) => SandboxRunner;\n"],"mappings":";AAyNA,MAAM,kCAAkC;CACvC,oCAAoC;EACnC,SAAS;EACT,QAAQ;EACR;CACD,qCAAqC;EACpC,SAAS;EACT,QAAQ;EACR;CACD,6BAA6B;EAC5B,SAAS;EACT,QAAQ;EACR;CACD,6BAA6B;EAC5B,SAAS;EACT,QAAQ;EACR;CACD;AAeD,SAAS,SAAS,OAAkD;AACnE,QAAO,OAAO,UAAU,YAAY,UAAU;;AAG/C,SAAS,wBAAwB,OAAgD;AAChF,QAAO,OAAO,UAAU,YAAY,SAAS;;AAG9C,SAAgB,4BAA4B,OAAiD;AAC5F,KAAI,CAAC,SAAS,MAAM,CAAE,QAAO;CAE7B,MAAM,eAAe,wBAAwB,MAAM,KAAK,GAAG,MAAM,OAAO;CACxE,MAAM,WACL,iBAAiB,SAAS,wBAAwB,MAAM,KAAK,GAAG,MAAM,OAAO;AAC9E,KAAI,gBAAgB,YAAY,iBAAiB,SAAU,QAAO;CAElE,MAAM,OAAO,gBAAgB;AAC7B,KAAI,CAAC,QAAS,MAAM,WAAW,UAAa,MAAM,WAAW,IAAM,QAAO;AAE1E,QAAO;EACN;EACA,GAAG,gCAAgC;EACnC;;AAGF,SAAgB,wBACf,MACmC;CACnC,MAAM,UAAoC;EACzC;EACA,GAAG,gCAAgC;EACnC;AACD,QAAO,OAAO,OAAO,IAAI,MAAM,QAAQ,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;;AAG1E,SAAgB,gCAAgC,OAAkD;CACjG,MAAM,UAAU,4BAA4B,MAAM;AAClD,QAAO,UAAU;EAAE,2BAA2B;EAAM,OAAO;EAAS,GAAG;;AAGxE,SAAgB,6BAA6B,OAAkD;AAC9F,KAAI,CAAC,SAAS,MAAM,IAAI,MAAM,8BAA8B,KAAM,QAAO;CACzE,MAAM,UAAU,4BAA4B,MAAM,MAAM;AACxD,QAAO,UAAU;EAAE,2BAA2B;EAAM,OAAO;EAAS,GAAG;;AA6DxE,SAAgB,sBAAsB,SAAiB,QAAsC;CAC5F,MAAM,SAAS,QAAQ,qBAAqB;AAC5C,QAAO,SAAS,GAAG,QAAQ,IAAI,WAAW;;;;;;AAO3C,IAAa,0BAAb,cAA6C,MAAM;CAClD,YAAY,UAAkB,QAAgB;AAC7C,QAAM,kCAAkC,SAAS,IAAI,SAAS;AAC9D,OAAK,OAAO"}