dineway 0.1.48 → 0.2.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 (420) hide show
  1. package/dist/{activity-events-C9u37D5z.mjs → activity-events-y6eT8UW6.mjs} +6 -38
  2. package/dist/actor-CrObAPV0.mjs +37 -0
  3. package/dist/after-BfniwgIf.mjs +9 -0
  4. package/dist/{allowed-origins-DhipQNLb.mjs → allowed-origins-_oeyP6x-.mjs} +1 -1
  5. package/dist/api/route-utils.d.mts +10 -10
  6. package/dist/api/route-utils.mjs +17 -14
  7. package/dist/api/schemas/index.d.mts +2 -2
  8. package/dist/api/schemas/index.mjs +5 -4
  9. package/dist/{api-Eiy8_zVZ.mjs → api-ByrU2q-Z.mjs} +61 -37
  10. package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-CjVMQT-X.mjs} +6 -2
  11. package/dist/{apply-CX3no7XE.mjs → apply-bZswmZPm.mjs} +117 -77
  12. package/dist/astro/image-endpoint.d.mts +7 -0
  13. package/dist/astro/image-endpoint.mjs +54 -0
  14. package/dist/astro/index.d.mts +35 -11
  15. package/dist/astro/index.mjs +157 -23
  16. package/dist/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
  17. package/dist/astro/integration/shims/use-sync-external-store.js +1 -0
  18. package/dist/astro/middleware/auth.d.mts +10 -10
  19. package/dist/astro/middleware/auth.mjs +42 -24
  20. package/dist/astro/middleware/redirect.mjs +14 -5
  21. package/dist/astro/middleware/request-context.mjs +9 -6
  22. package/dist/astro/middleware/seed.d.mts +1 -1
  23. package/dist/astro/middleware/seed.mjs +2 -2
  24. package/dist/astro/middleware/setup.mjs +1 -1
  25. package/dist/astro/middleware.mjs +334 -193
  26. package/dist/astro/routes/admin.astro +6 -1
  27. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
  28. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
  29. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  30. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  31. package/dist/astro/routes/api/admin/briefing.mjs +22 -18
  32. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  33. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -8
  34. package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -8
  35. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -8
  36. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +18 -15
  37. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +18 -15
  38. package/dist/astro/routes/api/admin/bylines/index.mjs +18 -15
  39. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +15 -13
  40. package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -6
  41. package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -10
  42. package/dist/astro/routes/api/admin/comments/counts.mjs +7 -6
  43. package/dist/astro/routes/api/admin/comments/index.mjs +12 -10
  44. package/dist/astro/routes/api/admin/context/_id_/history.mjs +27 -25
  45. package/dist/astro/routes/api/admin/context/_id_/index.mjs +27 -25
  46. package/dist/astro/routes/api/admin/context/_id_/review.mjs +32 -29
  47. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +32 -29
  48. package/dist/astro/routes/api/admin/context/diff.mjs +31 -28
  49. package/dist/astro/routes/api/admin/context/index.mjs +32 -29
  50. package/dist/astro/routes/api/admin/context/stale.mjs +31 -28
  51. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +27 -25
  52. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +31 -28
  53. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +31 -28
  54. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +28 -26
  55. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  56. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
  57. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
  58. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -52
  59. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -52
  60. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +48 -44
  61. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +54 -50
  62. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -49
  63. package/dist/astro/routes/api/admin/plugins/index.mjs +48 -44
  64. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  65. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +47 -43
  66. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +53 -49
  67. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +47 -43
  68. package/dist/astro/routes/api/admin/plugins/updates.mjs +47 -43
  69. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +6 -6
  70. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +32 -28
  71. package/dist/astro/routes/api/admin/review-requests/index.mjs +11 -10
  72. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +47 -43
  73. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  74. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +47 -43
  75. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
  76. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
  77. package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
  78. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
  79. package/dist/astro/routes/api/admin/users/index.mjs +7 -6
  80. package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
  81. package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
  82. package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
  83. package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
  84. package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
  85. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  86. package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
  87. package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
  88. package/dist/astro/routes/api/auth/me.mjs +10 -9
  89. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  90. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
  91. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  92. package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -5
  93. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  94. package/dist/astro/routes/api/auth/passkey/options.mjs +12 -11
  95. package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -9
  96. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -10
  97. package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -10
  98. package/dist/astro/routes/api/auth/setup-token/index.mjs +6 -6
  99. package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
  100. package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
  101. package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
  102. package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
  103. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +16 -14
  104. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +8 -0
  105. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +160 -0
  106. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  107. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -6
  108. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -6
  109. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -6
  110. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +12 -11
  111. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +11 -10
  112. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -6
  113. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  114. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -10
  115. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +17 -15
  116. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  117. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -6
  118. package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
  119. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  120. package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
  121. package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -6
  122. package/dist/astro/routes/api/dashboard.mjs +10 -9
  123. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  124. package/dist/astro/routes/api/health.mjs +1 -1
  125. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  126. package/dist/astro/routes/api/import/probe.mjs +23 -11
  127. package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -6
  128. package/dist/astro/routes/api/import/wordpress/execute.d.mts +19 -1
  129. package/dist/astro/routes/api/import/wordpress/execute.mjs +85 -38
  130. package/dist/astro/routes/api/import/wordpress/media.d.mts +13 -1
  131. package/dist/astro/routes/api/import/wordpress/media.mjs +20 -14
  132. package/dist/astro/routes/api/import/wordpress/prepare.mjs +36 -33
  133. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +18 -1
  134. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +121 -101
  135. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  136. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +25 -13
  137. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  138. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +56 -2
  139. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +284 -56
  140. package/dist/astro/routes/api/manifest.mjs +14 -5
  141. package/dist/astro/routes/api/mcp.mjs +266 -70
  142. package/dist/astro/routes/api/media/_id_/confirm.mjs +39 -11
  143. package/dist/astro/routes/api/media/_id_.mjs +11 -7
  144. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  145. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  146. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  147. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  148. package/dist/astro/routes/api/media/upload-url.mjs +12 -11
  149. package/dist/astro/routes/api/media.mjs +28 -35
  150. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +32 -29
  151. package/dist/astro/routes/api/menus/_name_/items.mjs +32 -29
  152. package/dist/astro/routes/api/menus/_name_/reorder.mjs +32 -29
  153. package/dist/astro/routes/api/menus/_name_/translations.mjs +32 -29
  154. package/dist/astro/routes/api/menus/_name_.mjs +32 -29
  155. package/dist/astro/routes/api/menus/index.mjs +32 -29
  156. package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
  157. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  158. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  159. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  160. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  161. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  162. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  163. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  164. package/dist/astro/routes/api/openapi.json.mjs +4 -3
  165. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +30 -30
  166. package/dist/astro/routes/api/redirects/404s/index.mjs +12 -11
  167. package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -11
  168. package/dist/astro/routes/api/redirects/_id_.mjs +33 -30
  169. package/dist/astro/routes/api/redirects/index.mjs +33 -30
  170. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  171. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  172. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +48 -44
  173. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +48 -44
  174. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +48 -44
  175. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +48 -44
  176. package/dist/astro/routes/api/schema/collections/index.mjs +48 -44
  177. package/dist/astro/routes/api/schema/index.mjs +13 -14
  178. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +47 -43
  179. package/dist/astro/routes/api/schema/orphans/index.mjs +47 -43
  180. package/dist/astro/routes/api/search/enable.mjs +12 -11
  181. package/dist/astro/routes/api/search/index.mjs +11 -10
  182. package/dist/astro/routes/api/search/rebuild.mjs +12 -11
  183. package/dist/astro/routes/api/search/stats.mjs +7 -7
  184. package/dist/astro/routes/api/search/suggest.mjs +11 -10
  185. package/dist/astro/routes/api/sections/_slug_.mjs +32 -29
  186. package/dist/astro/routes/api/sections/index.mjs +32 -29
  187. package/dist/astro/routes/api/settings/email.mjs +4 -4
  188. package/dist/astro/routes/api/settings.mjs +32 -29
  189. package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
  190. package/dist/astro/routes/api/setup/admin.mjs +12 -11
  191. package/dist/astro/routes/api/setup/dev-bypass.mjs +32 -26
  192. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  193. package/dist/astro/routes/api/setup/index.mjs +30 -26
  194. package/dist/astro/routes/api/setup/status.mjs +3 -3
  195. package/dist/astro/routes/api/snapshot.mjs +9 -8
  196. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +35 -32
  197. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +35 -32
  198. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +35 -32
  199. package/dist/astro/routes/api/taxonomies/index.mjs +35 -32
  200. package/dist/astro/routes/api/themes/preview.mjs +6 -6
  201. package/dist/astro/routes/api/typegen.mjs +4 -4
  202. package/dist/astro/routes/api/well-known/auth.mjs +3 -3
  203. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  204. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  205. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +31 -28
  206. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +32 -29
  207. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +32 -29
  208. package/dist/astro/routes/api/widget-areas/_name_.mjs +29 -27
  209. package/dist/astro/routes/api/widget-areas/index.mjs +32 -29
  210. package/dist/astro/routes/api/widget-components.mjs +2 -2
  211. package/dist/astro/routes/robots.txt.mjs +9 -8
  212. package/dist/astro/routes/sitemap-_collection_.xml.mjs +24 -15
  213. package/dist/astro/routes/sitemap.xml.mjs +10 -9
  214. package/dist/astro/session-driver.d.mts +1 -1
  215. package/dist/astro/session-driver.mjs +3 -3
  216. package/dist/astro/types.d.mts +21 -13
  217. package/dist/{audit-D1cbG7xH.mjs → audit-ByVKIwWF.mjs} +1 -1
  218. package/dist/auth/providers/github.d.mts +1 -1
  219. package/dist/auth/providers/google.d.mts +1 -1
  220. package/dist/{auth-control-guard-Dr14I98m.mjs → auth-control-guard-CqeUmQsv.mjs} +1 -1
  221. package/dist/{authorize-BLO0m7fW.mjs → authorize-CcBxcHtz.mjs} +1 -1
  222. package/dist/{briefing-CObXGOGz.mjs → briefing-BJaJI8dm.mjs} +2 -1
  223. package/dist/{briefing-gKWiGLt1.mjs → briefing-CawZ59CY.mjs} +90 -28
  224. package/dist/bundle-7C_DpkEq.mjs +602 -0
  225. package/dist/{byline-1ntDwv8c.mjs → byline-e51-fWRs.mjs} +30 -62
  226. package/dist/{byline-fields-BX7rWKNU.d.mts → byline-fields-CUvbslGc.d.mts} +49 -6
  227. package/dist/{byline-fields-C9_iaPaM.mjs → byline-fields-D-N5qVIG.mjs} +1 -1
  228. package/dist/{byline-fields-B-ZkoVft.mjs → byline-fields-DOJO16Gm.mjs} +3 -3
  229. package/dist/{byline-registry-CUSvkasJ.mjs → byline-registry-87nNnYl4.mjs} +2 -2
  230. package/dist/{bylines-bC15ZqAv.mjs → bylines-CMQNCNFh.mjs} +9 -3
  231. package/dist/{bylines-DtxChhN_.mjs → bylines-y4LO-dTj.mjs} +5 -5
  232. package/dist/{cache-DbKyr60Q.mjs → cache-C-FNTFYK.mjs} +2 -2
  233. package/dist/{chunks-C5zp2xir.mjs → chunks-CxBt-GxR.mjs} +1 -1
  234. package/dist/cli/index.mjs +820 -1276
  235. package/dist/client/external-auth-headers.d.mts +1 -1
  236. package/dist/client/index.d.mts +1 -1
  237. package/dist/client/index.mjs +2 -1
  238. package/dist/{comment-CXDOQ93N.mjs → comment-DlA4iChg.mjs} +13 -3
  239. package/dist/comment-reaction-DfFao1ST.mjs +58 -0
  240. package/dist/{comments-hK-rdzJ9.mjs → comments-DApFGMsP.mjs} +1 -1
  241. package/dist/{content-QaryevFO.mjs → content-Bh4BDjv8.mjs} +51 -34
  242. package/dist/content-refresh-CgutSUfO.mjs +1576 -0
  243. package/dist/{context-CoYb_fvK.mjs → context-C5W3G18y.mjs} +111 -50
  244. package/dist/{context-DBL1ib4v.mjs → context-CK4ym2Sf.mjs} +2 -2
  245. package/dist/{context-route-helpers-CYQVmbIm.mjs → context-route-helpers-MASyGgWf.mjs} +2 -1
  246. package/dist/{cron-DxCAU_Sn.mjs → cron-cKcNTix_.mjs} +7 -3
  247. package/dist/{dashboard-DNlqsknJ.mjs → dashboard-DQkVT7Ei.mjs} +4 -4
  248. package/dist/db/index.d.mts +3 -3
  249. package/dist/db/index.mjs +1 -1
  250. package/dist/db/libsql.d.mts +1 -1
  251. package/dist/db/postgres.d.mts +1 -1
  252. package/dist/db/sqlite.d.mts +1 -1
  253. package/dist/{device-flow-DygsFPGL.mjs → device-flow-BnqRH-T9.mjs} +5 -5
  254. package/dist/{placeholder-BDo81Is5.mjs → enrich-DIFIFA8O.mjs} +36 -9
  255. package/dist/{error-DCSuUAZW.mjs → error-CytFlgcd.mjs} +5 -0
  256. package/dist/field-defs-cache-DRNdhBJv.mjs +49 -0
  257. package/dist/{fts-manager-CIZlScg5.mjs → fts-manager-Crzypjqu.mjs} +1 -1
  258. package/dist/hitl-Hw1RmWOq.mjs +677 -0
  259. package/dist/{hitl-requests-CGQwOEiq.mjs → hitl-requests-B4Vbcmaq.mjs} +2 -2
  260. package/dist/{hitl-route-helpers-GSDLNPpN.mjs → hitl-route-helpers-hEVzvP8l.mjs} +5 -4
  261. package/dist/import-Bh9biJfx.mjs +1354 -0
  262. package/dist/{index-CwRuZ-u8.d.mts → index-D4y6NGiy.d.mts} +75 -3
  263. package/dist/index.d.mts +17 -16
  264. package/dist/index.mjs +81 -69
  265. package/dist/{jsonld-DZ67souc.d.mts → jsonld-Dq0gsnOH.d.mts} +8 -4
  266. package/dist/{load-xE01Jm0V.mjs → load-DmYeniXl.mjs} +1 -1
  267. package/dist/{loader-tg63WSY2.mjs → loader-CjWqjweO.mjs} +117 -31
  268. package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-BxVPYMJR.mjs} +34 -1
  269. package/dist/mcp-reviewed-executor-TwVbMzG6.mjs +555 -0
  270. package/dist/media/image-endpoint.d.mts +32 -0
  271. package/dist/media/image-endpoint.mjs +111 -0
  272. package/dist/media/index.d.mts +27 -2
  273. package/dist/media/index.mjs +5 -3
  274. package/dist/media/local-runtime.d.mts +16 -11
  275. package/dist/media/local-runtime.mjs +10 -8
  276. package/dist/{media-DUAjMfvR.mjs → media-DMj0grzC.mjs} +3 -1
  277. package/dist/{media-allowlist-BsXkT9RK.mjs → media-allowlist-BlVCSzHx.mjs} +1 -1
  278. package/dist/media-url-lEKSrpr9.mjs +20 -0
  279. package/dist/{menus-WpFRMXjz.mjs → menus-TaW1gKnk.mjs} +19 -5
  280. package/dist/{menus-DU1eZqw_.mjs → menus-xvsnVZXw.mjs} +80 -15
  281. package/dist/{normalize-DUnoXAa9.mjs → normalize-5ek_z7de.mjs} +8 -1
  282. package/dist/{oauth-authorization-D-1p52Je.mjs → oauth-authorization-DiaGvRVz.mjs} +5 -5
  283. package/dist/{oauth-clients-CzeMGyUU.mjs → oauth-clients-Dl9E8dEM.mjs} +2 -2
  284. package/dist/object-cache/memory.d.mts +14 -0
  285. package/dist/object-cache/memory.mjs +55 -0
  286. package/dist/object-cache-D51qOseS.mjs +419 -0
  287. package/dist/page/index.d.mts +4 -3
  288. package/dist/page/index.mjs +2 -2
  289. package/dist/{parse-CneSgl7-.mjs → parse-CbymENaR.mjs} +1 -1
  290. package/dist/{parser-DxfsARXL.mjs → parser-C1nYd-81.mjs} +151 -9
  291. package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-uvNRZBX9.d.mts} +12 -4
  292. package/dist/plugin-utils.d.mts +9 -9
  293. package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
  294. package/dist/plugins/adapt-sandbox-entry.mjs +11 -2
  295. package/dist/{plugins-C57YQi4l.mjs → plugins-BolVa-tl.mjs} +832 -64
  296. package/dist/{transport-LSdZVXHF.mjs → portable-text-dA_UlJwW.mjs} +1 -134
  297. package/dist/{preview-D5rvDhRt.mjs → preview-vSVg6fwG.mjs} +4 -3
  298. package/dist/process-cache-7xgAO9JY.mjs +106 -0
  299. package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-MD8zAbnH.d.mts} +1 -1
  300. package/dist/{public-url-DLUM5OOv.mjs → public-url-BEz_sM9n.mjs} +24 -18
  301. package/dist/{public-url-B5HaoGzj.d.mts → public-url-gsp3oUbu.d.mts} +5 -4
  302. package/dist/{query-BYc3oruA.mjs → query-CfRCdaL3.mjs} +281 -76
  303. package/dist/{query-DKEwzobh.mjs → query-jaAmw8E1.mjs} +11 -6
  304. package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-ZLdyWoZF.mjs} +2 -2
  305. package/dist/{redirect-C2zXRj3c.mjs → redirect-BAjt4Z6b.mjs} +2 -2
  306. package/dist/{redirects-YZo_znWG.mjs → redirects-BTdwpQtE.mjs} +47 -24
  307. package/dist/{redirects-ocRJmQHP.mjs → redirects-CA-xylPG.mjs} +19 -11
  308. package/dist/{registry-CTkbIDB9.mjs → registry-CtyVedcN.mjs} +130 -77
  309. package/dist/request-context.d.mts +2 -0
  310. package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CUypToDJ.mjs} +1 -1
  311. package/dist/{review-requests-C0un5kdV.mjs → review-requests-C9Ff11Vq.mjs} +1 -1
  312. package/dist/{review-requests-gGMyYYhy.mjs → review-requests-DUyEmtmG.mjs} +1 -1
  313. package/dist/{runner-D4FL9usy.d.mts → runner-1tC2tIRV.d.mts} +1 -1
  314. package/dist/runner-DB7CRfOF.mjs +6740 -0
  315. package/dist/{runtime-DEWQpZ-4.d.mts → runtime-BOeiQsCv.d.mts} +2028 -1564
  316. package/dist/runtime.d.mts +10 -10
  317. package/dist/runtime.mjs +4 -4
  318. package/dist/schema-DXdYj4R3.mjs +8 -0
  319. package/dist/{search-axGQ1KY3.mjs → search-DSaLgEFI.mjs} +5 -3
  320. package/dist/{secrets-062Izo8i.mjs → secrets-CDZo2k8L.mjs} +15 -12
  321. package/dist/{sections-OLKgXL10.mjs → sections-PVVXHGfp.mjs} +2 -2
  322. package/dist/seed/index.d.mts +2 -2
  323. package/dist/seed/index.mjs +22 -19
  324. package/dist/seo/index.d.mts +1 -1
  325. package/dist/seo/index.mjs +3 -12
  326. package/dist/{seo-Cd45Po8L.mjs → seo-CQG3GCHQ.mjs} +5 -2
  327. package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-C1EnikHB.mjs} +11 -3
  328. package/dist/{seo-5lJOtB5J.mjs → seo-qa7Dn0jK.mjs} +22 -4
  329. package/dist/{service-Bwad8s5h.mjs → service-DiN4ZuPp.mjs} +2 -2
  330. package/dist/session-user-CAKImna3.mjs +22 -0
  331. package/dist/{settings-yLjz_I4T.mjs → settings-BbqgHWpU.mjs} +28 -55
  332. package/dist/{settings-lAHjaUit.mjs → settings-i4VPP8bT.mjs} +2 -2
  333. package/dist/{setup-complete--PradA4R.mjs → setup-complete-B8fl-mjV.mjs} +1 -1
  334. package/dist/{site-activity-D7Xyropw.mjs → site-activity-Dy3FROs0.mjs} +1 -1
  335. package/dist/{site-context-DaN9Z91j.mjs → site-context-DQiL8Fl5.mjs} +23 -652
  336. package/dist/{site-url-DpGZo9Z6.mjs → site-url-BML3GQYm.mjs} +1 -1
  337. package/dist/status-DANd8ERo.mjs +21 -0
  338. package/dist/storage/local.d.mts +1 -1
  339. package/dist/storage/local.mjs +1 -1
  340. package/dist/storage/s3.d.mts +1 -1
  341. package/dist/storage/s3.mjs +1 -1
  342. package/dist/{taxonomies-uXVEoQso.mjs → taxonomies-9s-v03H-.mjs} +36 -29
  343. package/dist/taxonomies-DRiixp_E.mjs +443 -0
  344. package/dist/{taxonomy-CBmkmMuU.mjs → taxonomy-Dvsw6BOs.mjs} +44 -9
  345. package/dist/{tokens-CjSgb0AC.mjs → tokens-1RK1n6ED.mjs} +1 -1
  346. package/dist/transport-BNmCqLu7.mjs +134 -0
  347. package/dist/types-4garmdWa.mjs +66 -0
  348. package/dist/{types-DSPGWjxO.d.mts → types-C8XW6L19.d.mts} +225 -4
  349. package/dist/{types-GaCtZ1k9.d.mts → types-CDpH6MA4.d.mts} +18 -0
  350. package/dist/{types-DRIKLmJI.d.mts → types-C_ly5eTp.d.mts} +17 -2
  351. package/dist/types-DF7ZuGGk.d.mts +118 -0
  352. package/dist/types-DU0bU2Wu.d.mts +2392 -0
  353. package/dist/{types-CwawBUTa.d.mts → types-DW_-sFyz.d.mts} +2 -1
  354. package/dist/{types-DfuD0Afl.mjs → types-Dq1qT19x.mjs} +2 -2
  355. package/dist/ui/server-runtime.d.mts +15 -15
  356. package/dist/ui/server-runtime.mjs +25 -21
  357. package/dist/url-Cac7a9QZ.mjs +33 -0
  358. package/dist/{user-DtNmjNYt.mjs → user-BIZPzCb9.mjs} +2 -2
  359. package/dist/{utils-wv-zvC-Y.mjs → utils-CMDhr5Xd.mjs} +129 -7
  360. package/dist/{validate-BMs11tan.d.mts → validate-CZvb-BKB.d.mts} +10 -7
  361. package/dist/{validate-7SYRbz2f.mjs → validate-DNs0pTSc.mjs} +11 -6
  362. package/dist/version-BTvfRGc6.mjs +6 -0
  363. package/dist/{widgets-DR8EHuRO.mjs → widgets-f0ibZUIq.mjs} +46 -43
  364. package/dist/{wordpress-slugs-Dvhxh4cl.mjs → wordpress-slugs-BhHJX8XE.mjs} +1 -1
  365. package/dist/{zod-generator-BS9-umbk.mjs → zod-generator-B7TMjyFJ.mjs} +41 -13
  366. package/package.json +31 -8
  367. package/src/components/Block.astro +50 -0
  368. package/src/components/Comments.astro +143 -1
  369. package/src/components/DinewayHead.astro +19 -2
  370. package/src/components/DinewayImage.astro +66 -33
  371. package/src/components/DinewayMedia.astro +1 -2
  372. package/src/components/Image.astro +85 -40
  373. package/src/components/InlinePortableTextEditor.tsx +12 -2
  374. package/src/components/JsonLdScript.astro +9 -0
  375. package/src/components/LiveSearch.astro +40 -4
  376. package/src/components/index.ts +4 -0
  377. package/src/components/live-search-routing.ts +30 -0
  378. package/src/components/portable-text-text-align.ts +15 -0
  379. package/src/ui.ts +2 -0
  380. package/dist/entity-aliases-Egjmqc7I.mjs +0 -51
  381. package/dist/import-CvHY6sf5.mjs +0 -684
  382. package/dist/runner-B-tbV751.mjs +0 -2741
  383. package/dist/schema-B6zyB-Xn.mjs +0 -8
  384. package/dist/taxonomies-CNOGeC-3.mjs +0 -327
  385. package/dist/types-eu5UDgHN.d.mts +0 -652
  386. package/dist/version-xlzMSXF2.mjs +0 -6
  387. /package/dist/{adapters-OQCImOL7.d.mts → adapters-NVSs4UH7.d.mts} +0 -0
  388. /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-2r7OWi_I.mjs} +0 -0
  389. /package/dist/{base64-C1Q9yr0B.mjs → base64-F8-DUraK.mjs} +0 -0
  390. /package/dist/{challenge-store-CRSz-Xim.mjs → challenge-store-Bjlepa2E.mjs} +0 -0
  391. /package/dist/{components--pg6zBvu.mjs → components-Bclf98Be.mjs} +0 -0
  392. /package/dist/{context-types-DQh_XKkn.mjs → context-types-DqTo6C79.mjs} +0 -0
  393. /package/dist/{default-B6iaLvP7.mjs → default--K40jqm0.mjs} +0 -0
  394. /package/dist/{email-console-BOVqIYpB.mjs → email-console-ChgKFO8-.mjs} +0 -0
  395. /package/dist/{escape-BDgouFFY.mjs → escape-Bd4P_xKg.mjs} +0 -0
  396. /package/dist/{experimental-workflows-Dh4DUoD_.mjs → experimental-workflows-BMsUnIAw.mjs} +0 -0
  397. /package/dist/{mime-8pAB8-77.mjs → mime-CA7Lgovc.mjs} +0 -0
  398. /package/dist/{mode-CpyEz8pe.mjs → mode-C4CIyjtR.mjs} +0 -0
  399. /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CNoXafF7.mjs} +0 -0
  400. /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-Ygw4bNyt.mjs} +0 -0
  401. /package/dist/{options-BvJoSSJR.mjs → options-DQPTH5n0.mjs} +0 -0
  402. /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-BUwu8BA3.mjs} +0 -0
  403. /package/dist/{patterns-r-0n824Y.mjs → patterns-BhAvqO0S.mjs} +0 -0
  404. /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-D0w9dqjm.mjs} +0 -0
  405. /package/dist/{redirect-BjIBtDWY.mjs → redirect-wphRBv4y.mjs} +0 -0
  406. /package/dist/{request-cache-CYMbwZc6.mjs → request-cache-D9GQBxMP.mjs} +0 -0
  407. /package/dist/{resolve-DTuDyYKs.mjs → resolve-Cb6Dbz-C.mjs} +0 -0
  408. /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-CoyjILvW.mjs} +0 -0
  409. /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-C3mqXg4C.mjs} +0 -0
  410. /package/dist/{slugify-BzGxlOFx.mjs → slugify-KSsVD_D3.mjs} +0 -0
  411. /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-DWe8jwAp.mjs} +0 -0
  412. /package/dist/{transaction-CShMWIej.mjs → transaction-C2EOMTJA.mjs} +0 -0
  413. /package/dist/{transport-BnsNxh2l.d.mts → transport-CcJu3Co8.d.mts} +0 -0
  414. /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-DTXQ2IMv.mjs} +0 -0
  415. /package/dist/{types-BO8TGjS8.mjs → types-B3t5cxhU.mjs} +0 -0
  416. /package/dist/{types-nP9vGUFq.d.mts → types-C46EvNdc.d.mts} +0 -0
  417. /package/dist/{types-Cg276-3z.mjs → types-C5CVgwsV.mjs} +0 -0
  418. /package/dist/{types-DZpT-PnG.d.mts → types-POH8PQZh.d.mts} +0 -0
  419. /package/dist/{types-Dryvv7LH.d.mts → types-Rc3gQqqw.d.mts} +0 -0
  420. /package/dist/{url-w7Mp5qAD.mjs → url-CpyFDFpO.mjs} +0 -0
@@ -1,81 +1,94 @@
1
- import { i as runMigrations } from "../runner-B-tbV751.mjs";
1
+ import { i as runMigrations } from "../runner-DB7CRfOF.mjs";
2
2
  import "../connection-CiJWiWya.mjs";
3
3
  import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
4
4
  import { s as isSqlite } from "../dialect-helpers-fk43GbDb.mjs";
5
5
  import { i as setI18nConfig } from "../config-CVssduLe.mjs";
6
- import { d as EmailPipeline, g as after, h as definePlugin, m as resolveExclusiveHooks, p as createHookPipeline, u as PluginRouteRegistry } from "../plugins-C57YQi4l.mjs";
7
- import { r as RevisionRepository, t as ContentRepository } from "../content-QaryevFO.mjs";
8
- import "../base64-C1Q9yr0B.mjs";
9
- import "../types-DfuD0Afl.mjs";
10
- import { t as MediaRepository } from "../media-DUAjMfvR.mjs";
11
- import "../user-DtNmjNYt.mjs";
12
- import "../taxonomy-CBmkmMuU.mjs";
13
- import "../comment-CXDOQ93N.mjs";
14
- import { t as OptionsRepository } from "../options-BvJoSSJR.mjs";
15
- import "../audit-D1cbG7xH.mjs";
16
- import "../site-activity-D7Xyropw.mjs";
17
- import "../review-requests-gGMyYYhy.mjs";
18
- import "../entity-aliases-Egjmqc7I.mjs";
19
- import "../context-CoYb_fvK.mjs";
20
- import "../menus-WpFRMXjz.mjs";
21
- import "../redirect-C2zXRj3c.mjs";
6
+ import { _ as readBoundedPluginRouteBody, d as EmailPipeline, g as DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES, h as definePlugin, m as resolveExclusiveHooks, p as createHookPipeline, u as PluginRouteRegistry } from "../plugins-BolVa-tl.mjs";
22
7
  import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
23
- import { r as requestCached } from "../request-cache-CYMbwZc6.mjs";
24
- import "../byline-registry-CUSvkasJ.mjs";
25
- import "../byline-1ntDwv8c.mjs";
26
- import { n as normalizeMediaValue } from "../normalize-DUnoXAa9.mjs";
27
- import "../placeholder-BDo81Is5.mjs";
28
- import "../seo-Cd45Po8L.mjs";
29
- import { $ as handleContentUpdate, A as handleRevisionGet, B as handleContentDiscardDraft, D as handleMediaGet, E as handleMediaDelete, F as handleContentCompare, G as handleContentListTrashed, H as handleContentGet, I as handleContentCountScheduled, J as handleContentRestore, K as handleContentPermanentDelete, L as handleContentCountTrashed, M as handleRevisionRestore, O as handleMediaList, P as handleContentAuthors, Q as handleContentUnschedule, R as handleContentCreate, T as handleMediaCreate, U as handleContentGetIncludingTrashed, V as handleContentDuplicate, W as handleContentList, X as handleContentTranslations, Y as handleContentSchedule, Z as handleContentUnpublish, d as createPluginBundleStore, et as validateRev, j as handleRevisionList, k as handleMediaUpdate, q as handleContentPublish, z as handleContentDelete } from "../api-Eiy8_zVZ.mjs";
30
- import "../dashboard-DNlqsknJ.mjs";
31
- import { u as PluginStateRepository } from "../briefing-gKWiGLt1.mjs";
32
- import "../context-types-DQh_XKkn.mjs";
33
- import { t as FTSManager } from "../fts-manager-CIZlScg5.mjs";
34
- import { n as SchemaRegistry } from "../registry-CTkbIDB9.mjs";
35
8
  import { createRecorder, flushRecorder, formatServerTimingHeader, isInstrumentationEnabled, isServerTimingEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
36
- import { a as isMissingTableError, r as getDb } from "../loader-tg63WSY2.mjs";
37
- import { c as createPublicMediaUrlResolver } from "../settings-yLjz_I4T.mjs";
38
- import "../briefing-CObXGOGz.mjs";
39
- import "../review-requests-C0un5kdV.mjs";
9
+ import "../base64-F8-DUraK.mjs";
10
+ import "../types-Dq1qT19x.mjs";
11
+ import { o as isMissingTableError, r as getDb } from "../loader-CjWqjweO.mjs";
12
+ import { t as after } from "../after-BfniwgIf.mjs";
13
+ import "../object-cache-D51qOseS.mjs";
14
+ import { r as RevisionRepository, t as ContentRepository } from "../content-Bh4BDjv8.mjs";
15
+ import { t as MediaRepository } from "../media-DMj0grzC.mjs";
16
+ import "../user-BIZPzCb9.mjs";
17
+ import "../taxonomy-Dvsw6BOs.mjs";
18
+ import "../comment-DlA4iChg.mjs";
19
+ import { t as OptionsRepository } from "../options-DQPTH5n0.mjs";
20
+ import "../audit-ByVKIwWF.mjs";
21
+ import "../site-activity-Dy3FROs0.mjs";
22
+ import "../review-requests-DUyEmtmG.mjs";
23
+ import "../hitl-Hw1RmWOq.mjs";
24
+ import { t as PluginContextFactory } from "../context-C5W3G18y.mjs";
25
+ import "../menus-TaW1gKnk.mjs";
26
+ import "../redirect-BAjt4Z6b.mjs";
27
+ import { r as requestCached } from "../request-cache-D9GQBxMP.mjs";
28
+ import "../byline-registry-87nNnYl4.mjs";
29
+ import { a as initWithLock, i as createInitLock, r as processCachedAsync, t as createProcessCache } from "../process-cache-7xgAO9JY.mjs";
30
+ import "../field-defs-cache-DRNdhBJv.mjs";
31
+ import "../byline-e51-fWRs.mjs";
32
+ import { n as normalizeMediaValue } from "../normalize-5ek_z7de.mjs";
33
+ import "../enrich-DIFIFA8O.mjs";
34
+ import "../seo-CQG3GCHQ.mjs";
35
+ import { $ as handleContentUpdate, A as handleRevisionGet, B as handleContentDiscardDraft, D as handleMediaGet, E as handleMediaDelete, F as handleContentCompare, G as handleContentListTrashed, H as handleContentGet, I as handleContentCountScheduled, J as handleContentRestore, K as handleContentPermanentDelete, L as handleContentCountTrashed, M as handleRevisionRestore, O as handleMediaList, P as handleContentAuthors, Q as handleContentUnschedule, R as handleContentCreate, T as handleMediaCreate, U as handleContentGetIncludingTrashed, V as handleContentDuplicate, W as handleContentList, X as handleContentTranslations, Y as handleContentSchedule, Z as handleContentUnpublish, d as createPluginBundleStore, et as validateRev, j as handleRevisionList, k as handleMediaUpdate, q as handleContentPublish, z as handleContentDelete } from "../api-ByrU2q-Z.mjs";
36
+ import "../dashboard-DQkVT7Ei.mjs";
37
+ import { u as PluginStateRepository } from "../briefing-CawZ59CY.mjs";
38
+ import "../context-types-DqTo6C79.mjs";
39
+ import { i as markContentMediaUsageCollectionStale, o as refreshContentMediaUsageAfterWrite, r as findNonTranslatableSiblingContentIds, t as deleteContentMediaUsage } from "../content-refresh-CgutSUfO.mjs";
40
40
  import { n as hashString } from "../hash-BPmX6P8I.mjs";
41
- import { n as VERSION, t as COMMIT } from "../version-xlzMSXF2.mjs";
42
- import "../query-DKEwzobh.mjs";
43
- import "../zod-generator-BS9-umbk.mjs";
44
- import "../schema-B6zyB-Xn.mjs";
45
- import "../seo-5lJOtB5J.mjs";
46
- import "../bylines-bC15ZqAv.mjs";
47
- import "../byline-fields-C9_iaPaM.mjs";
48
- import "../sections-OLKgXL10.mjs";
49
- import "../settings-lAHjaUit.mjs";
50
- import "../resolve-DTuDyYKs.mjs";
51
- import "../taxonomies-CNOGeC-3.mjs";
52
- import "../taxonomies-uXVEoQso.mjs";
53
- import { r as normalizeManifestRoute } from "../manifest-schema-qh2P7RDX.mjs";
54
- import "../parse-CneSgl7-.mjs";
55
- import "../redirects-ocRJmQHP.mjs";
56
- import "../byline-fields-B-ZkoVft.mjs";
57
- import { a as invalidateUrlPatternCache } from "../query-BYc3oruA.mjs";
58
- import "../preview-D5rvDhRt.mjs";
59
- import "../parser-DxfsARXL.mjs";
60
- import { t as getTrustedProxyHeaders } from "../trusted-proxy-BgIIcbsN.mjs";
61
- import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-DAb6xaP9.mjs";
62
- import "../ssrf-DiKqWd3N.mjs";
63
- import { n as CronExecutor } from "../cron-DxCAU_Sn.mjs";
64
- import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-BOVqIYpB.mjs";
65
- import "../import-CvHY6sf5.mjs";
66
- import "../utils-wv-zvC-Y.mjs";
67
- import "../tokens-CjSgb0AC.mjs";
68
- import "../menus-DU1eZqw_.mjs";
69
- import "../bylines-DtxChhN_.mjs";
70
- import "../widgets-DR8EHuRO.mjs";
71
- import "../apply-CX3no7XE.mjs";
72
- import "../load-xE01Jm0V.mjs";
73
- import "../search-axGQ1KY3.mjs";
41
+ import { t as FTSManager } from "../fts-manager-Crzypjqu.mjs";
42
+ import { n as SchemaRegistry } from "../registry-CtyVedcN.mjs";
43
+ import { r as createPublicMediaUrlResolver } from "../url-Cac7a9QZ.mjs";
44
+ import "../settings-BbqgHWpU.mjs";
45
+ import "../briefing-BJaJI8dm.mjs";
46
+ import "../review-requests-C9Ff11Vq.mjs";
47
+ import { n as VERSION, t as COMMIT } from "../version-BTvfRGc6.mjs";
48
+ import "../query-jaAmw8E1.mjs";
49
+ import "../zod-generator-B7TMjyFJ.mjs";
50
+ import "../schema-DXdYj4R3.mjs";
51
+ import "../seo-qa7Dn0jK.mjs";
52
+ import "../bylines-CMQNCNFh.mjs";
53
+ import "../byline-fields-D-N5qVIG.mjs";
54
+ import "../sections-PVVXHGfp.mjs";
55
+ import "../settings-i4VPP8bT.mjs";
56
+ import "../resolve-Cb6Dbz-C.mjs";
57
+ import "../taxonomies-DRiixp_E.mjs";
58
+ import "../taxonomies-9s-v03H-.mjs";
59
+ import { r as normalizeManifestRoute } from "../manifest-schema-BxVPYMJR.mjs";
60
+ import "../parse-CbymENaR.mjs";
61
+ import "../redirects-CA-xylPG.mjs";
62
+ import "../byline-fields-DOJO16Gm.mjs";
63
+ import "../status-DANd8ERo.mjs";
64
+ import { t as getTrustedProxyHeaders } from "../trusted-proxy-DTXQ2IMv.mjs";
65
+ import "../rate-limit-ZLdyWoZF.mjs";
66
+ import { a as invalidateUrlPatternCache } from "../query-CfRCdaL3.mjs";
67
+ import "../preview-vSVg6fwG.mjs";
68
+ import "../parser-C1nYd-81.mjs";
69
+ import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-CUypToDJ.mjs";
70
+ import "../ssrf-DWe8jwAp.mjs";
71
+ import { n as CronExecutor } from "../cron-cKcNTix_.mjs";
72
+ import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-ChgKFO8-.mjs";
73
+ import { o as validateEncryptionKeyAtStartup } from "../secrets-CDZo2k8L.mjs";
74
+ import "../api-tokens-2r7OWi_I.mjs";
75
+ import { n as createActivePluginMcpRegistry } from "../mcp-reviewed-executor-TwVbMzG6.mjs";
76
+ import "../activity-events-y6eT8UW6.mjs";
77
+ import "../import-Bh9biJfx.mjs";
78
+ import "../utils-CMDhr5Xd.mjs";
79
+ import "../tokens-1RK1n6ED.mjs";
80
+ import "../comment-reaction-DfFao1ST.mjs";
81
+ import "../menus-xvsnVZXw.mjs";
82
+ import "../bylines-y4LO-dTj.mjs";
83
+ import "../widgets-f0ibZUIq.mjs";
84
+ import "../apply-bZswmZPm.mjs";
85
+ import "../load-DmYeniXl.mjs";
86
+ import "../search-DSaLgEFI.mjs";
74
87
  import "../index.mjs";
75
- import { t as getAuthMode } from "../mode-CpyEz8pe.mjs";
76
- import { i as experimentalSiteContextWorkflowsEnabled } from "../experimental-workflows-Dh4DUoD_.mjs";
77
- import { t as cleanupExpiredChallenges } from "../challenge-store-CRSz-Xim.mjs";
78
- import { a as validateEncryptionKeyAtStartup } from "../secrets-062Izo8i.mjs";
88
+ import { t as getAuthMode } from "../mode-C4CIyjtR.mjs";
89
+ import { i as experimentalSiteContextWorkflowsEnabled } from "../experimental-workflows-BMsUnIAw.mjs";
90
+ import { t as cleanupExpiredChallenges } from "../challenge-store-Bjlepa2E.mjs";
91
+ import { t as resolveSessionUser } from "../session-user-CAKImna3.mjs";
79
92
  import { Kysely, sql } from "kysely";
80
93
  import { defineMiddleware } from "astro:middleware";
81
94
  import virtualConfig from "virtual:dineway/config";
@@ -387,47 +400,6 @@ async function publishDueContent(db, options = {}) {
387
400
  return published;
388
401
  }
389
402
 
390
- //#endregion
391
- //#region src/utils/init-lock.ts
392
- const DEFAULT_DEADLINE_MS = 15e3;
393
- const DEFAULT_POLL_MS = 50;
394
- const MAX_WAIT_HEADROOM_MS = 15e3;
395
- function sleep(ms) {
396
- return new Promise((resolve) => setTimeout(resolve, ms));
397
- }
398
- function createInitLock() {
399
- return {
400
- ownerStartedAt: null,
401
- generation: 0
402
- };
403
- }
404
- async function initWithLock(lock, getCached, init, options) {
405
- const deadlineMs = options?.deadlineMs ?? DEFAULT_DEADLINE_MS;
406
- const pollMs = options?.pollMs ?? DEFAULT_POLL_MS;
407
- const maxWaitMs = options?.maxWaitMs ?? deadlineMs + MAX_WAIT_HEADROOM_MS;
408
- const waitStart = Date.now();
409
- for (;;) {
410
- const cached = getCached();
411
- if (cached !== null && cached !== void 0) return cached;
412
- const ownerStartedAt = lock.ownerStartedAt;
413
- if (ownerStartedAt === null || Date.now() - ownerStartedAt > deadlineMs) {
414
- lock.generation += 1;
415
- const claim = lock.generation;
416
- lock.ownerStartedAt = Date.now();
417
- try {
418
- const isCurrentClaim = () => lock.generation === claim;
419
- const initPromise = Promise.resolve().then(() => init(isCurrentClaim));
420
- options?.anchor?.(initPromise.then(() => void 0, () => void 0));
421
- return await initPromise;
422
- } finally {
423
- if (lock.generation === claim) lock.ownerStartedAt = null;
424
- }
425
- }
426
- if (Date.now() - waitStart > maxWaitMs) throw new Error(`initWithLock: timed out after ${maxWaitMs}ms waiting for initialization`);
427
- await sleep(pollMs);
428
- }
429
- }
430
-
431
403
  //#endregion
432
404
  //#region src/dineway-runtime.ts
433
405
  const LEADING_SLASH_PATTERN = /^\//;
@@ -553,7 +525,6 @@ var DinewayRuntime = class DinewayRuntime {
553
525
  configuredPlugins;
554
526
  sandboxedPlugins;
555
527
  sandboxedPluginEntries;
556
- schemaRegistry;
557
528
  _hooks;
558
529
  config;
559
530
  mediaProviders;
@@ -576,10 +547,8 @@ var DinewayRuntime = class DinewayRuntime {
576
547
  runtimeDeps;
577
548
  /** Mutable ref for the cron invokeCronHook closure to read the current pipeline */
578
549
  pipelineRef;
579
- /** Tracks whether FTS health has already been checked for this runtime instance. */
580
- _searchHealthChecked = false;
581
- /** Shared in-flight FTS health verification promise. */
582
- _searchHealthPromise = null;
550
+ /** Process-lifetime FTS health check cache that never stores an in-flight promise. */
551
+ _searchHealthCache = createProcessCache();
583
552
  /**
584
553
  * Get the database instance for the current request.
585
554
  *
@@ -599,7 +568,6 @@ var DinewayRuntime = class DinewayRuntime {
599
568
  this.configuredPlugins = configuredPlugins;
600
569
  this.sandboxedPlugins = sandboxedPlugins;
601
570
  this.sandboxedPluginEntries = sandboxedPluginEntries;
602
- this.schemaRegistry = new SchemaRegistry(db);
603
571
  this._hooks = hooks;
604
572
  this.enabledPlugins = enabledPlugins;
605
573
  this.pluginStates = pluginStates;
@@ -620,6 +588,32 @@ var DinewayRuntime = class DinewayRuntime {
620
588
  getSandboxRunner() {
621
589
  return sandboxRunner;
622
590
  }
591
+ get schemaRegistry() {
592
+ return new SchemaRegistry(this.db);
593
+ }
594
+ /**
595
+ * Resolve native MCP contributions from the current active plugin set.
596
+ * The registry is derived per request so activate/deactivate changes cannot
597
+ * leave a stateless MCP server with a stale contribution snapshot.
598
+ */
599
+ getPluginMcpRegistry() {
600
+ return createActivePluginMcpRegistry(this.configuredPlugins, this.enabledPlugins);
601
+ }
602
+ /**
603
+ * Resolve the outbound HTTP capability for an active native plugin.
604
+ * MCP handlers use this instead of reaching for global fetch, so the same
605
+ * capability and SSRF rules apply to routes, hooks, and MCP contributions.
606
+ */
607
+ getPluginHttpAccess(pluginId) {
608
+ if (!this.enabledPlugins.has(pluginId)) return void 0;
609
+ const plugin = this.configuredPlugins.find((candidate) => candidate.id === pluginId);
610
+ if (!plugin) return void 0;
611
+ return new PluginContextFactory({
612
+ ...this.pipelineFactoryOptions,
613
+ emailPipeline: this.email ?? void 0,
614
+ cronReschedule: this.cronScheduler ? () => this.cronScheduler?.reschedule() : void 0
615
+ }).createContext(plugin).http;
616
+ }
623
617
  /**
624
618
  * Publish any content whose scheduled time has passed.
625
619
  * Routes through the runtime wrapper so after-publish hooks still fire.
@@ -679,26 +673,29 @@ var DinewayRuntime = class DinewayRuntime {
679
673
  *
680
674
  * Search health is deferred off the runtime cold-start path so ordinary
681
675
  * page loads do not pay the index verification cost. Concurrent callers
682
- * share a single in-flight check, and once it has completed the result is
683
- * treated as healthy for the lifetime of this runtime instance.
676
+ * coalesce without sharing an in-flight promise, and once it has completed
677
+ * the result is treated as healthy for the lifetime of this runtime instance.
684
678
  */
685
679
  async ensureSearchHealthy() {
686
- if (this._searchHealthChecked) return;
687
- if (this._searchHealthPromise) return this._searchHealthPromise;
688
- if (!isSqlite(this.db)) {
689
- this._searchHealthChecked = true;
690
- return;
691
- }
692
- this._searchHealthPromise = (async () => {
680
+ const requestDb = getRequestContextDatabase();
681
+ const db = requestDb ?? this._db;
682
+ if (!isSqlite(db)) return;
683
+ const verify = async () => {
693
684
  try {
694
- const repaired = await new FTSManager(this.db).verifyAndRepairAll();
685
+ const repaired = await new FTSManager(db).verifyAndRepairAll();
695
686
  if (repaired > 0) console.log(`Repaired ${repaired} corrupted FTS index(es)`);
696
- } catch {} finally {
697
- this._searchHealthChecked = true;
698
- this._searchHealthPromise = null;
699
- }
700
- })();
701
- return this._searchHealthPromise;
687
+ } catch {}
688
+ };
689
+ if (requestDb) {
690
+ await verify();
691
+ return;
692
+ }
693
+ try {
694
+ await processCachedAsync(this._searchHealthCache, verify, {
695
+ anchor: (promise) => after(() => promise),
696
+ ownerTimeoutMs: 3e4
697
+ });
698
+ } catch {}
702
699
  }
703
700
  /**
704
701
  * Update in-memory plugin status and rebuild the hook pipeline.
@@ -731,10 +728,7 @@ var DinewayRuntime = class DinewayRuntime {
731
728
  async rebuildHookPipeline() {
732
729
  const newPipeline = createHookPipeline(this.allPipelinePlugins.filter((p) => this.enabledPlugins.has(p.id)), this.pipelineFactoryOptions);
733
730
  await DinewayRuntime.resolveExclusiveHooks(newPipeline, this.db, this.runtimeDeps);
734
- if (this.email) newPipeline.setContextFactory({
735
- db: this.db,
736
- emailPipeline: this.email
737
- });
731
+ if (this.email) newPipeline.setContextFactory({ emailPipeline: this.email });
738
732
  if (this.cronScheduler) {
739
733
  const scheduler = this.cronScheduler;
740
734
  newPipeline.setContextFactory({ cronReschedule: () => scheduler.reschedule() });
@@ -816,7 +810,10 @@ var DinewayRuntime = class DinewayRuntime {
816
810
  const routeMetaMap = /* @__PURE__ */ new Map();
817
811
  for (const entry of bundle.manifest.routes) {
818
812
  const normalized = normalizeManifestRoute(entry);
819
- routeMetaMap.set(normalized.name, { public: normalized.public === true });
813
+ routeMetaMap.set(normalized.name, {
814
+ public: normalized.public === true,
815
+ body: "json"
816
+ });
820
817
  }
821
818
  sandboxedRouteMetaCache.set(pluginId, routeMetaMap);
822
819
  } else sandboxedRouteMetaCache.delete(pluginId);
@@ -843,6 +840,7 @@ var DinewayRuntime = class DinewayRuntime {
843
840
  }
844
841
  };
845
842
  const db = await phase("rt.db", "DB init + migrations", () => DinewayRuntime.getDatabase(deps));
843
+ const resolveDb = () => getRequestContextDatabase() ?? db;
846
844
  await phase("rt.secrets", "Validate encryption key", () => validateEncryptionKeyAtStartup());
847
845
  const storage = DinewayRuntime.getStorage(deps);
848
846
  let pluginStates = /* @__PURE__ */ new Map();
@@ -906,6 +904,7 @@ var DinewayRuntime = class DinewayRuntime {
906
904
  const trustedProxyHeaders = getTrustedProxyHeaders(deps.config);
907
905
  const pipelineFactoryOptions = {
908
906
  db,
907
+ getDb: resolveDb,
909
908
  storage: storage ?? void 0,
910
909
  siteInfo,
911
910
  trustedProxyHeaders
@@ -924,6 +923,7 @@ var DinewayRuntime = class DinewayRuntime {
924
923
  const mediaProviderEntries = deps.mediaProviderEntries ?? [];
925
924
  const providerContext = {
926
925
  db,
926
+ getDb: resolveDb,
927
927
  storage
928
928
  };
929
929
  for (const entry of mediaProviderEntries) try {
@@ -940,15 +940,12 @@ var DinewayRuntime = class DinewayRuntime {
940
940
  const result = await pipelineRef.current.invokeCronHook(pluginId, event);
941
941
  if (!result.success && result.error) throw result.error;
942
942
  };
943
- pipeline.setContextFactory({
944
- db,
945
- emailPipeline
946
- });
943
+ pipeline.setContextFactory({ emailPipeline });
947
944
  let cronExecutor = null;
948
945
  const runtimeRef = { current: null };
949
946
  await phase("rt.cron", "Cron init (recovery deferred post-response)", async () => {
950
947
  try {
951
- cronExecutor = new CronExecutor(db, invokeCronHook);
948
+ cronExecutor = new CronExecutor(resolveDb, invokeCronHook);
952
949
  const executorForRecovery = cronExecutor;
953
950
  after(async () => {
954
951
  try {
@@ -979,6 +976,18 @@ var DinewayRuntime = class DinewayRuntime {
979
976
  console.warn("[cron] Failed to initialize cron system:", error);
980
977
  }
981
978
  });
979
+ await phase("rt.pluginLifecycle", "Configured plugin first-start lifecycle", async () => {
980
+ const stateRepository = new PluginStateRepository(db);
981
+ for (const plugin of deps.plugins) {
982
+ if (pluginStates.has(plugin.id)) continue;
983
+ const installFailure = (await pipeline.runPluginInstall(plugin.id)).find((result) => !result.success);
984
+ if (installFailure) throw new Error(`Plugin install failed for "${plugin.id}": ${installFailure.error?.message ?? "Unknown error"}`);
985
+ const activateFailure = (await pipeline.runPluginActivate(plugin.id)).find((result) => !result.success);
986
+ if (activateFailure) throw new Error(`Plugin activation failed for "${plugin.id}": ${activateFailure.error?.message ?? "Unknown error"}`);
987
+ await stateRepository.enable(plugin.id, plugin.version);
988
+ pluginStates.set(plugin.id, "active");
989
+ }
990
+ });
982
991
  const runtime = new DinewayRuntime(db, storage, deps.plugins, sandboxedPlugins, deps.sandboxedPluginEntries, pipeline, enabledPlugins, pluginStates, deps.config, mediaProviders, mediaProviderEntries, cronExecutor, cronScheduler, emailPipeline, allPipelinePlugins, pipelineFactoryOptions, deps, pipelineRef);
983
992
  runtimeRef.current = runtime;
984
993
  return runtime;
@@ -1030,9 +1039,9 @@ var DinewayRuntime = class DinewayRuntime {
1030
1039
  }
1031
1040
  })();
1032
1041
  if (collectionCount.count === 0 && !setupDone) {
1033
- const { applySeed } = await import("../apply-CX3no7XE.mjs").then((n) => n.n);
1034
- const { loadSeed } = await import("../load-xE01Jm0V.mjs").then((n) => n.r);
1035
- const { validateSeed } = await import("../validate-7SYRbz2f.mjs").then((n) => n.n);
1042
+ const { applySeed } = await import("../apply-bZswmZPm.mjs").then((n) => n.n);
1043
+ const { loadSeed } = await import("../load-DmYeniXl.mjs").then((n) => n.r);
1044
+ const { validateSeed } = await import("../validate-DNs0pTSc.mjs").then((n) => n.n);
1036
1045
  const seed = await loadSeed();
1037
1046
  if (validateSeed(seed).valid) {
1038
1047
  await applySeed(db, seed, { onConflict: "skip" });
@@ -1130,7 +1139,10 @@ var DinewayRuntime = class DinewayRuntime {
1130
1139
  const routeMeta = /* @__PURE__ */ new Map();
1131
1140
  for (const entry of bundle.manifest.routes) {
1132
1141
  const normalized = normalizeManifestRoute(entry);
1133
- routeMeta.set(normalized.name, { public: normalized.public === true });
1142
+ routeMeta.set(normalized.name, {
1143
+ public: normalized.public === true,
1144
+ body: "json"
1145
+ });
1134
1146
  }
1135
1147
  sandboxedRouteMetaCache.set(plugin.pluginId, routeMeta);
1136
1148
  }
@@ -1238,7 +1250,9 @@ var DinewayRuntime = class DinewayRuntime {
1238
1250
  sandboxed: true,
1239
1251
  adminMode: hasAdminPages || hasWidgets ? "blocks" : "none",
1240
1252
  adminPages: entry.adminPages ?? [],
1241
- dashboardWidgets: entry.adminWidgets ?? []
1253
+ dashboardWidgets: entry.adminWidgets ?? [],
1254
+ portableTextBlocks: entry.portableTextBlocks,
1255
+ fieldWidgets: entry.fieldWidgets
1242
1256
  };
1243
1257
  }
1244
1258
  for (const [pluginId, meta] of marketplaceManifestCache) {
@@ -1318,11 +1332,13 @@ var DinewayRuntime = class DinewayRuntime {
1318
1332
  authorId: body.authorId,
1319
1333
  bylines: body.bylines
1320
1334
  });
1321
- if (result.success && result.data) this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, true);
1335
+ if (result.success && result.data) {
1336
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1337
+ this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, true);
1338
+ }
1322
1339
  return result;
1323
1340
  }
1324
1341
  async handleContentUpdate(collection, id, body) {
1325
- const { ContentRepository } = await import("../content-QaryevFO.mjs").then((n) => n.n);
1326
1342
  const repo = new ContentRepository(this.db);
1327
1343
  const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
1328
1344
  const resolvedId = resolvedItem?.id ?? id;
@@ -1393,7 +1409,21 @@ var DinewayRuntime = class DinewayRuntime {
1393
1409
  authorId: bodyWithoutRev.authorId,
1394
1410
  bylines: bodyWithoutRev.bylines
1395
1411
  });
1396
- if (result.success && result.data) this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, false);
1412
+ if (result.success && result.data) {
1413
+ const contentIdsToRefresh = [resolvedId];
1414
+ if (!usesDraftRevisions && processedData) try {
1415
+ contentIdsToRefresh.push(...await findNonTranslatableSiblingContentIds(this.db, collection, resolvedId, result.data.item.translationGroup, processedData));
1416
+ } catch (error) {
1417
+ console.error(`[media-usage] Failed to discover synced i18n siblings for ${collection}/${resolvedId}:`, error);
1418
+ try {
1419
+ await markContentMediaUsageCollectionStale(this.db, collection, "CONTENT_USAGE_REFRESH_ERROR");
1420
+ } catch (staleError) {
1421
+ console.error(`[media-usage] Failed to mark ${collection} stale:`, staleError);
1422
+ }
1423
+ }
1424
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, contentIdsToRefresh);
1425
+ this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, false);
1426
+ }
1397
1427
  return result;
1398
1428
  }
1399
1429
  async handleContentDelete(collection, id) {
@@ -1414,48 +1444,81 @@ var DinewayRuntime = class DinewayRuntime {
1414
1444
  message: "Delete blocked by sandboxed plugin hook"
1415
1445
  }
1416
1446
  };
1447
+ const contentId = await this.resolveContentId(collection, id, false);
1417
1448
  const result = await handleContentDelete(this.db, collection, id);
1418
- if (result.success) this.runAfterDeleteHooks(id, collection, false);
1449
+ if (result.success) {
1450
+ if (contentId) await this.refreshContentUsageAfterSuccessfulWrite(collection, [contentId]);
1451
+ this.runAfterDeleteHooks(id, collection, false);
1452
+ }
1419
1453
  return result;
1420
1454
  }
1421
1455
  async handleContentListTrashed(collection, params = {}) {
1422
1456
  return handleContentListTrashed(this.db, collection, params);
1423
1457
  }
1424
1458
  async handleContentRestore(collection, id) {
1425
- return handleContentRestore(this.db, collection, id);
1459
+ const result = await handleContentRestore(this.db, collection, id);
1460
+ if (result.success) {
1461
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1462
+ this.runAfterRestoreHooks(contentItemToRecord(result.data.item), collection);
1463
+ }
1464
+ return result;
1426
1465
  }
1427
1466
  async handleContentPermanentDelete(collection, id) {
1467
+ const contentId = await this.resolveContentId(collection, id, true);
1428
1468
  const result = await handleContentPermanentDelete(this.db, collection, id);
1429
- if (result.success) this.runAfterDeleteHooks(id, collection, true);
1469
+ if (result.success) {
1470
+ if (contentId) await this.deleteContentUsageAfterSuccessfulPermanentDelete(collection, contentId);
1471
+ this.runAfterDeleteHooks(id, collection, true);
1472
+ }
1430
1473
  return result;
1431
1474
  }
1432
1475
  async handleContentCountTrashed(collection) {
1433
1476
  return handleContentCountTrashed(this.db, collection);
1434
1477
  }
1435
1478
  async handleContentDuplicate(collection, id, authorId) {
1436
- return handleContentDuplicate(this.db, collection, id, authorId);
1479
+ const result = await handleContentDuplicate(this.db, collection, id, authorId);
1480
+ if (result.success && result.data) await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1481
+ return result;
1437
1482
  }
1438
1483
  async handleContentPublish(collection, id, options = {}) {
1439
1484
  const result = await handleContentPublish(this.db, collection, id, options);
1440
- if (result.success && result.data) this.runAfterPublishHooks(contentItemToRecord(result.data.item), collection);
1485
+ if (result.success && result.data) {
1486
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1487
+ this.runAfterPublishHooks(contentItemToRecord(result.data.item), collection);
1488
+ }
1441
1489
  return result;
1442
1490
  }
1443
1491
  async handleContentUnpublish(collection, id) {
1444
1492
  const result = await handleContentUnpublish(this.db, collection, id);
1445
- if (result.success && result.data) this.runAfterUnpublishHooks(contentItemToRecord(result.data.item), collection);
1493
+ if (result.success && result.data) {
1494
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1495
+ this.runAfterUnpublishHooks(contentItemToRecord(result.data.item), collection);
1496
+ }
1446
1497
  return result;
1447
1498
  }
1448
1499
  async handleContentSchedule(collection, id, scheduledAt) {
1449
- return handleContentSchedule(this.db, collection, id, scheduledAt);
1500
+ const result = await handleContentSchedule(this.db, collection, id, scheduledAt);
1501
+ if (result.success && result.data) {
1502
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1503
+ this.runAfterScheduleHooks(contentItemToRecord(result.data.item), collection);
1504
+ }
1505
+ return result;
1450
1506
  }
1451
1507
  async handleContentUnschedule(collection, id) {
1452
- return handleContentUnschedule(this.db, collection, id);
1508
+ const result = await handleContentUnschedule(this.db, collection, id);
1509
+ if (result.success && result.data) {
1510
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1511
+ this.runAfterUnscheduleHooks(contentItemToRecord(result.data.item), collection);
1512
+ }
1513
+ return result;
1453
1514
  }
1454
1515
  async handleContentCountScheduled(collection) {
1455
1516
  return handleContentCountScheduled(this.db, collection);
1456
1517
  }
1457
1518
  async handleContentDiscardDraft(collection, id) {
1458
- return handleContentDiscardDraft(this.db, collection, id);
1519
+ const result = await handleContentDiscardDraft(this.db, collection, id);
1520
+ if (result.success && result.data) await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1521
+ return result;
1459
1522
  }
1460
1523
  async handleContentCompare(collection, id) {
1461
1524
  return handleContentCompare(this.db, collection, id);
@@ -1463,6 +1526,25 @@ var DinewayRuntime = class DinewayRuntime {
1463
1526
  async handleContentTranslations(collection, id) {
1464
1527
  return handleContentTranslations(this.db, collection, id);
1465
1528
  }
1529
+ async refreshContentUsageAfterSuccessfulWrite(collection, contentIds) {
1530
+ for (const contentId of new Set(contentIds)) try {
1531
+ await refreshContentMediaUsageAfterWrite(this.db, collection, contentId);
1532
+ } catch (error) {
1533
+ console.error(`[media-usage] Failed after content write ${collection}/${contentId}:`, error);
1534
+ }
1535
+ }
1536
+ async deleteContentUsageAfterSuccessfulPermanentDelete(collection, contentId) {
1537
+ try {
1538
+ const result = await deleteContentMediaUsage(this.db, collection, contentId);
1539
+ if (!result.success) console.error(`[media-usage] Usage delete for ${collection}/${contentId} finished with ${result.errorCode}`);
1540
+ } catch (error) {
1541
+ console.error(`[media-usage] Failed after permanent content delete ${collection}/${contentId}:`, error);
1542
+ }
1543
+ }
1544
+ async resolveContentId(collection, id, includeTrashed) {
1545
+ const repo = new ContentRepository(this.db);
1546
+ return (includeTrashed ? await repo.findByIdOrSlugIncludingTrashed(collection, id) : await repo.findByIdOrSlug(collection, id))?.id ?? null;
1547
+ }
1466
1548
  async handleMediaList(params) {
1467
1549
  return handleMediaList(this.db, params);
1468
1550
  }
@@ -1526,7 +1608,12 @@ var DinewayRuntime = class DinewayRuntime {
1526
1608
  if (trustedPlugin) {
1527
1609
  const route = trustedPlugin.routes[routeKey];
1528
1610
  if (!route) return null;
1529
- return { public: route.public === true };
1611
+ return {
1612
+ public: route.public === true,
1613
+ body: route.body ?? "json",
1614
+ ...route.body === "raw" ? { maxBodyBytes: route.maxBodyBytes ?? DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES } : {},
1615
+ authorization: route.authorization
1616
+ };
1530
1617
  }
1531
1618
  const meta = sandboxedRouteMetaCache.get(pluginId);
1532
1619
  if (meta) {
@@ -1535,14 +1622,23 @@ var DinewayRuntime = class DinewayRuntime {
1535
1622
  }
1536
1623
  if (routeKey === "admin") {
1537
1624
  const manifestMeta = marketplaceManifestCache.get(pluginId);
1538
- if (manifestMeta?.admin?.pages?.length || manifestMeta?.admin?.widgets?.length) return { public: false };
1625
+ if (manifestMeta?.admin?.pages?.length || manifestMeta?.admin?.widgets?.length) return {
1626
+ public: false,
1627
+ body: "json"
1628
+ };
1539
1629
  const entry = this.sandboxedPluginEntries.find((e) => e.id === pluginId);
1540
- if (entry?.adminPages?.length || entry?.adminWidgets?.length) return { public: false };
1630
+ if (entry?.adminPages?.length || entry?.adminWidgets?.length) return {
1631
+ public: false,
1632
+ body: "json"
1633
+ };
1541
1634
  }
1542
- if (this.findSandboxedPlugin(pluginId)) return { public: false };
1635
+ if (this.findSandboxedPlugin(pluginId)) return {
1636
+ public: false,
1637
+ body: "json"
1638
+ };
1543
1639
  return null;
1544
1640
  }
1545
- async handlePluginApiRoute(pluginId, _method, path, request) {
1641
+ async handlePluginApiRoute(pluginId, _method, path, request, invocation) {
1546
1642
  if (!this.isPluginEnabled(pluginId)) return {
1547
1643
  success: false,
1548
1644
  error: {
@@ -1555,22 +1651,41 @@ var DinewayRuntime = class DinewayRuntime {
1555
1651
  const routeRegistry = new PluginRouteRegistry({
1556
1652
  ...this.pipelineFactoryOptions,
1557
1653
  db: this.db,
1654
+ storage: this.storage ?? void 0,
1558
1655
  emailPipeline: this.email ?? void 0,
1559
1656
  trustedProxyHeaders: getTrustedProxyHeaders(this.config)
1560
1657
  });
1561
1658
  routeRegistry.register(trustedPlugin);
1562
1659
  const routeKey = path.replace(LEADING_SLASH_PATTERN, "");
1660
+ const trustedRoute = trustedPlugin.routes[routeKey];
1661
+ if ((trustedRoute?.body ?? "json") === "raw") {
1662
+ const bodyResult = await readBoundedPluginRouteBody(request, trustedRoute?.maxBodyBytes ?? DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES);
1663
+ if (!bodyResult.ok) return {
1664
+ success: false,
1665
+ error: {
1666
+ code: "PAYLOAD_TOO_LARGE",
1667
+ message: `Plugin route request body exceeds ${bodyResult.limit} bytes`
1668
+ },
1669
+ status: 413
1670
+ };
1671
+ return routeRegistry.invoke(pluginId, routeKey, {
1672
+ request,
1673
+ rawBody: bodyResult.bytes,
1674
+ actor: invocation?.actor
1675
+ });
1676
+ }
1563
1677
  let body = void 0;
1564
1678
  try {
1565
1679
  body = await request.json();
1566
1680
  } catch {}
1567
1681
  return routeRegistry.invoke(pluginId, routeKey, {
1568
1682
  request,
1569
- body
1683
+ body,
1684
+ actor: invocation?.actor
1570
1685
  });
1571
1686
  }
1572
1687
  const sandboxedPlugin = this.findSandboxedPlugin(pluginId);
1573
- if (sandboxedPlugin) return this.handleSandboxedRoute(sandboxedPlugin, path, request);
1688
+ if (sandboxedPlugin) return this.handleSandboxedRoute(sandboxedPlugin, path, request, invocation?.actor);
1574
1689
  return {
1575
1690
  success: false,
1576
1691
  error: {
@@ -1685,11 +1800,42 @@ var DinewayRuntime = class DinewayRuntime {
1685
1800
  }
1686
1801
  }
1687
1802
  runAfterPublishHooks(content, collection) {
1803
+ this.runDeferredContentHook("content:afterPublish", content, collection);
1804
+ }
1805
+ runAfterUnpublishHooks(content, collection) {
1806
+ this.runDeferredContentHook("content:afterUnpublish", content, collection);
1807
+ }
1808
+ runAfterRestoreHooks(content, collection) {
1809
+ this.runDeferredContentHook("content:afterRestore", content, collection);
1810
+ }
1811
+ runAfterScheduleHooks(content, collection) {
1812
+ this.runDeferredContentHook("content:afterSchedule", content, collection);
1813
+ }
1814
+ runAfterUnscheduleHooks(content, collection) {
1815
+ this.runDeferredContentHook("content:afterUnschedule", content, collection);
1816
+ }
1817
+ runDeferredContentHook(name, content, collection) {
1688
1818
  after(async () => {
1689
- if (this.hooks.hasHooks("content:afterPublish")) try {
1690
- await this.hooks.runContentAfterPublish(content, collection);
1819
+ if (this.hooks.hasHooks(name)) try {
1820
+ switch (name) {
1821
+ case "content:afterPublish":
1822
+ await this.hooks.runContentAfterPublish(content, collection);
1823
+ break;
1824
+ case "content:afterUnpublish":
1825
+ await this.hooks.runContentAfterUnpublish(content, collection);
1826
+ break;
1827
+ case "content:afterRestore":
1828
+ await this.hooks.runContentAfterRestore(content, collection);
1829
+ break;
1830
+ case "content:afterSchedule":
1831
+ await this.hooks.runContentAfterSchedule(content, collection);
1832
+ break;
1833
+ case "content:afterUnschedule":
1834
+ await this.hooks.runContentAfterUnschedule(content, collection);
1835
+ break;
1836
+ }
1691
1837
  } catch (err) {
1692
- console.error("Dineway afterPublish hook error:", err);
1838
+ console.error(`Dineway ${name} hook error:`, err);
1693
1839
  }
1694
1840
  const tasks = [];
1695
1841
  for (const [pluginKey, plugin] of this.sandboxedPlugins) {
@@ -1697,30 +1843,19 @@ var DinewayRuntime = class DinewayRuntime {
1697
1843
  if (!pluginId || !this.isPluginEnabled(pluginId)) continue;
1698
1844
  tasks.push((async () => {
1699
1845
  try {
1700
- await plugin.invokeHook("content:afterPublish", {
1846
+ await plugin.invokeHook(name, {
1701
1847
  content,
1702
1848
  collection
1703
1849
  });
1704
1850
  } catch (err) {
1705
- console.error(`Dineway: Sandboxed plugin ${pluginId} afterPublish error:`, err);
1851
+ console.error(`Dineway: Sandboxed plugin ${pluginId} ${name} error:`, err);
1706
1852
  }
1707
1853
  })());
1708
1854
  }
1709
1855
  await Promise.allSettled(tasks);
1710
1856
  });
1711
1857
  }
1712
- runAfterUnpublishHooks(content, collection) {
1713
- if (this.hooks.hasHooks("content:afterUnpublish")) this.hooks.runContentAfterUnpublish(content, collection).catch((err) => console.error("Dineway afterUnpublish hook error:", err));
1714
- for (const [pluginKey, plugin] of this.sandboxedPlugins) {
1715
- const [pluginId] = pluginKey.split(":");
1716
- if (!pluginId || !this.isPluginEnabled(pluginId)) continue;
1717
- plugin.invokeHook("content:afterUnpublish", {
1718
- content,
1719
- collection
1720
- }).catch((err) => console.error(`Dineway: Sandboxed plugin ${pluginId} afterUnpublish error:`, err));
1721
- }
1722
- }
1723
- async handleSandboxedRoute(plugin, path, request) {
1858
+ async handleSandboxedRoute(plugin, path, request, actor) {
1724
1859
  const routeName = path.replace(LEADING_SLASH_PATTERN, "");
1725
1860
  let body = void 0;
1726
1861
  try {
@@ -1735,7 +1870,8 @@ var DinewayRuntime = class DinewayRuntime {
1735
1870
  url: request.url,
1736
1871
  method: request.method,
1737
1872
  headers,
1738
- meta
1873
+ meta,
1874
+ actor: actor ?? null
1739
1875
  })
1740
1876
  };
1741
1877
  } catch (error) {
@@ -1982,9 +2118,9 @@ function setBaselineSecurityHeaders(response, pathname, serverTimings) {
1982
2118
  const res = new Response(response.body, response);
1983
2119
  const astroCookies = Reflect.get(response, ASTRO_COOKIES_SYMBOL);
1984
2120
  if (astroCookies !== void 0) Reflect.set(res, ASTRO_COOKIES_SYMBOL, astroCookies);
1985
- res.headers.set("X-Content-Type-Options", "nosniff");
1986
- res.headers.set("Referrer-Policy", "strict-origin-when-cross-origin");
1987
- res.headers.set("Permissions-Policy", "camera=(), microphone=(), geolocation=(), payment=()");
2121
+ if (!res.headers.has("X-Content-Type-Options")) res.headers.set("X-Content-Type-Options", "nosniff");
2122
+ if (!res.headers.has("Referrer-Policy")) res.headers.set("Referrer-Policy", "strict-origin-when-cross-origin");
2123
+ if (!res.headers.has("Permissions-Policy")) res.headers.set("Permissions-Policy", "camera=(), microphone=(), geolocation=(), payment=()");
1988
2124
  const shouldSetFrameOptions = !import.meta.env.DEV || pathname.startsWith("/_dineway");
1989
2125
  if (!res.headers.has("Content-Security-Policy") && shouldSetFrameOptions) res.headers.set("X-Frame-Options", "SAMEORIGIN");
1990
2126
  if (serverTimings && serverTimings.length > 0) res.headers.set("Server-Timing", formatServerTimingHeader(serverTimings));
@@ -2059,11 +2195,11 @@ const onRequest = defineMiddleware(async (context, next) => {
2059
2195
  const requestDb = locals.__dinewayRequestDb;
2060
2196
  if (!isDinewayRoute && !isPublicRuntimeRoute && !hasEditCookie && !hasPreviewToken) {
2061
2197
  const hasSessionCookie = cookies.get("astro-session") !== void 0;
2062
- if (!(context.isPrerendered || !hasSessionCookie ? null : await context.session?.get("user")) && !requestDb) {
2063
- if (!isSetupVerified()) {
2198
+ if (!(context.isPrerendered || !hasSessionCookie ? null : await resolveSessionUser(context.session)) && !requestDb) {
2199
+ if (!isSetupVerified() && !context.isPrerendered) {
2064
2200
  const setupStart = startServerTiming(serverTimings);
2065
2201
  try {
2066
- const { getDb } = await import("../loader-tg63WSY2.mjs").then((n) => n.i);
2202
+ const { getDb } = await import("../loader-CjWqjweO.mjs").then((n) => n.i);
2067
2203
  await (await getDb()).selectFrom("_dineway_migrations").selectAll().limit(1).execute();
2068
2204
  markSetupVerified();
2069
2205
  } catch (error) {
@@ -2117,6 +2253,7 @@ const onRequest = defineMiddleware(async (context, next) => {
2117
2253
  locals.dineway = {
2118
2254
  handleContentList: runtime.handleContentList.bind(runtime),
2119
2255
  handleContentGet: runtime.handleContentGet.bind(runtime),
2256
+ handleContentAuthors: runtime.handleContentAuthors.bind(runtime),
2120
2257
  handleContentCreate: runtime.handleContentCreate.bind(runtime),
2121
2258
  handleContentUpdate: runtime.handleContentUpdate.bind(runtime),
2122
2259
  handleContentDelete: runtime.handleContentDelete.bind(runtime),
@@ -2145,6 +2282,7 @@ const onRequest = defineMiddleware(async (context, next) => {
2145
2282
  handlePluginApiRoute: runtime.handlePluginApiRoute.bind(runtime),
2146
2283
  handlePublicPluginApiRoute: createPublicPluginApiRouteHandler(runtime),
2147
2284
  getPluginRouteMeta: runtime.getPluginRouteMeta.bind(runtime),
2285
+ getPluginHttpAccess: runtime.getPluginHttpAccess.bind(runtime),
2148
2286
  getMediaProvider: runtime.getMediaProvider.bind(runtime),
2149
2287
  getMediaProviderList: runtime.getMediaProviderList.bind(runtime),
2150
2288
  collectPageMetadata: runtime.collectPageMetadata.bind(runtime),
@@ -2156,6 +2294,7 @@ const onRequest = defineMiddleware(async (context, next) => {
2156
2294
  hooks: runtime.hooks,
2157
2295
  email: runtime.email,
2158
2296
  configuredPlugins: runtime.configuredPlugins,
2297
+ sandboxedPluginEntries: runtime.sandboxedPluginEntries,
2159
2298
  config,
2160
2299
  getManifest: runtime.getManifest.bind(runtime),
2161
2300
  invalidateManifest: runtime.invalidateManifest.bind(runtime),
@@ -2179,10 +2318,12 @@ const onRequest = defineMiddleware(async (context, next) => {
2179
2318
  return runWithContext(parentContext ? {
2180
2319
  ...parentContext,
2181
2320
  editMode,
2182
- db: requestDb
2321
+ db: requestDb,
2322
+ dbIsIsolated: true
2183
2323
  } : {
2184
2324
  editMode,
2185
- db: requestDb
2325
+ db: requestDb,
2326
+ dbIsIsolated: true
2186
2327
  }, doInit);
2187
2328
  }
2188
2329
  return doInit();