dineway 0.1.49 → 0.2.1

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 (434) hide show
  1. package/dist/activity-DUaz_w7p.mjs +79 -0
  2. package/dist/{activity-events-CwM7yxPW.mjs → activity-events-CJDvE2uc.mjs} +5 -113
  3. package/dist/actor-0QJ1Gbtf.mjs +37 -0
  4. package/dist/after-BfniwgIf.mjs +9 -0
  5. package/dist/{allowed-origins-CyGnbgBd.mjs → allowed-origins--OwHHiY8.mjs} +1 -1
  6. package/dist/api/route-utils.d.mts +9 -10
  7. package/dist/api/route-utils.mjs +16 -13
  8. package/dist/api/schemas/index.d.mts +2 -2
  9. package/dist/api/schemas/index.mjs +5 -4
  10. package/dist/{api-BMIxRIEN.mjs → api-B4PHIF4V.mjs} +93 -41
  11. package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-tbK_sORH.mjs} +6 -2
  12. package/dist/{apply-D_RlTYtC.mjs → apply-DjTqq6Ae.mjs} +117 -77
  13. package/dist/astro/image-endpoint.d.mts +7 -0
  14. package/dist/astro/image-endpoint.mjs +54 -0
  15. package/dist/astro/index.d.mts +34 -11
  16. package/dist/astro/index.mjs +163 -24
  17. package/dist/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
  18. package/dist/astro/integration/shims/use-sync-external-store.js +1 -0
  19. package/dist/astro/middleware/auth.d.mts +8 -18
  20. package/dist/astro/middleware/auth.mjs +42 -24
  21. package/dist/astro/middleware/redirect.mjs +13 -4
  22. package/dist/astro/middleware/request-context.mjs +8 -5
  23. package/dist/astro/middleware/seed.d.mts +1 -1
  24. package/dist/astro/middleware/seed.mjs +2 -2
  25. package/dist/astro/middleware/setup.mjs +1 -1
  26. package/dist/astro/middleware.mjs +389 -206
  27. package/dist/astro/routes/admin.astro +6 -1
  28. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
  29. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
  30. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  31. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  32. package/dist/astro/routes/api/admin/briefing.mjs +21 -17
  33. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  34. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -8
  35. package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -8
  36. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -8
  37. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -14
  38. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -14
  39. package/dist/astro/routes/api/admin/bylines/index.mjs +17 -14
  40. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -12
  41. package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -5
  42. package/dist/astro/routes/api/admin/comments/bulk.mjs +11 -9
  43. package/dist/astro/routes/api/admin/comments/counts.mjs +6 -5
  44. package/dist/astro/routes/api/admin/comments/index.mjs +11 -9
  45. package/dist/astro/routes/api/admin/context/_id_/history.mjs +27 -24
  46. package/dist/astro/routes/api/admin/context/_id_/index.mjs +27 -24
  47. package/dist/astro/routes/api/admin/context/_id_/review.mjs +32 -28
  48. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +32 -28
  49. package/dist/astro/routes/api/admin/context/diff.mjs +31 -27
  50. package/dist/astro/routes/api/admin/context/index.mjs +32 -28
  51. package/dist/astro/routes/api/admin/context/stale.mjs +31 -27
  52. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +27 -24
  53. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +31 -27
  54. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +31 -27
  55. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +28 -25
  56. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  57. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
  58. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
  59. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -51
  60. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -51
  61. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -43
  62. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +54 -49
  63. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -48
  64. package/dist/astro/routes/api/admin/plugins/index.mjs +47 -43
  65. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  66. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +46 -42
  67. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +53 -48
  68. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +46 -42
  69. package/dist/astro/routes/api/admin/plugins/updates.mjs +46 -42
  70. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
  71. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +32 -63
  72. package/dist/astro/routes/api/admin/review-requests/index.d.mts +2 -1
  73. package/dist/astro/routes/api/admin/review-requests/index.mjs +58 -10
  74. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +46 -42
  75. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  76. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +46 -42
  77. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
  78. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
  79. package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
  80. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
  81. package/dist/astro/routes/api/admin/users/index.mjs +7 -6
  82. package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
  83. package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
  84. package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
  85. package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
  86. package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
  87. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  88. package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
  89. package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
  90. package/dist/astro/routes/api/auth/me.mjs +9 -8
  91. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  92. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
  93. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  94. package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -5
  95. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  96. package/dist/astro/routes/api/auth/passkey/options.mjs +12 -11
  97. package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -9
  98. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -10
  99. package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -10
  100. package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
  101. package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
  102. package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
  103. package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
  104. package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
  105. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -13
  106. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +8 -0
  107. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +160 -0
  108. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  109. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -5
  110. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
  111. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -5
  112. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -10
  113. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +49 -20
  114. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -5
  115. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  116. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +67 -32
  117. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -14
  118. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  119. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -5
  120. package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -9
  121. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  122. package/dist/astro/routes/api/content/_collection_/index.mjs +11 -9
  123. package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -6
  124. package/dist/astro/routes/api/dashboard.mjs +9 -8
  125. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  126. package/dist/astro/routes/api/health.mjs +1 -1
  127. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  128. package/dist/astro/routes/api/import/probe.mjs +22 -10
  129. package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -6
  130. package/dist/astro/routes/api/import/wordpress/execute.d.mts +18 -1
  131. package/dist/astro/routes/api/import/wordpress/execute.mjs +85 -37
  132. package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -1
  133. package/dist/astro/routes/api/import/wordpress/media.mjs +20 -14
  134. package/dist/astro/routes/api/import/wordpress/prepare.mjs +36 -32
  135. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +17 -1
  136. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +121 -100
  137. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  138. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -12
  139. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +55 -2
  140. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +284 -55
  141. package/dist/astro/routes/api/manifest.mjs +14 -5
  142. package/dist/astro/routes/api/mcp.mjs +753 -170
  143. package/dist/astro/routes/api/media/_id_/confirm.mjs +38 -10
  144. package/dist/astro/routes/api/media/_id_.mjs +11 -7
  145. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  146. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  147. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  148. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  149. package/dist/astro/routes/api/media/upload-url.mjs +11 -10
  150. package/dist/astro/routes/api/media.mjs +28 -35
  151. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +32 -28
  152. package/dist/astro/routes/api/menus/_name_/items.mjs +32 -28
  153. package/dist/astro/routes/api/menus/_name_/reorder.mjs +32 -28
  154. package/dist/astro/routes/api/menus/_name_/translations.mjs +32 -28
  155. package/dist/astro/routes/api/menus/_name_.mjs +32 -28
  156. package/dist/astro/routes/api/menus/index.mjs +32 -28
  157. package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
  158. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  159. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  160. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  161. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  162. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  163. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  164. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  165. package/dist/astro/routes/api/openapi.json.mjs +4 -3
  166. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +46 -31
  167. package/dist/astro/routes/api/redirects/404s/index.mjs +11 -10
  168. package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -10
  169. package/dist/astro/routes/api/redirects/_id_.mjs +33 -29
  170. package/dist/astro/routes/api/redirects/index.mjs +33 -29
  171. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  172. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  173. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +48 -43
  174. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +48 -43
  175. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +48 -43
  176. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +48 -43
  177. package/dist/astro/routes/api/schema/collections/index.mjs +48 -43
  178. package/dist/astro/routes/api/schema/index.mjs +14 -15
  179. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +46 -42
  180. package/dist/astro/routes/api/schema/orphans/index.mjs +46 -42
  181. package/dist/astro/routes/api/search/enable.mjs +11 -10
  182. package/dist/astro/routes/api/search/index.mjs +10 -9
  183. package/dist/astro/routes/api/search/rebuild.mjs +11 -10
  184. package/dist/astro/routes/api/search/stats.mjs +6 -6
  185. package/dist/astro/routes/api/search/suggest.mjs +10 -9
  186. package/dist/astro/routes/api/sections/_slug_.mjs +32 -28
  187. package/dist/astro/routes/api/sections/index.mjs +32 -28
  188. package/dist/astro/routes/api/settings/email.mjs +4 -4
  189. package/dist/astro/routes/api/settings.mjs +32 -28
  190. package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
  191. package/dist/astro/routes/api/setup/admin.mjs +12 -11
  192. package/dist/astro/routes/api/setup/dev-bypass.mjs +31 -25
  193. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  194. package/dist/astro/routes/api/setup/index.mjs +29 -25
  195. package/dist/astro/routes/api/setup/status.mjs +3 -3
  196. package/dist/astro/routes/api/snapshot.mjs +8 -7
  197. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +35 -31
  198. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +35 -31
  199. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +35 -31
  200. package/dist/astro/routes/api/taxonomies/index.mjs +35 -31
  201. package/dist/astro/routes/api/themes/preview.mjs +5 -5
  202. package/dist/astro/routes/api/typegen.mjs +4 -4
  203. package/dist/astro/routes/api/well-known/auth.mjs +3 -3
  204. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  205. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  206. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +31 -27
  207. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +32 -28
  208. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +32 -28
  209. package/dist/astro/routes/api/widget-areas/_name_.mjs +29 -26
  210. package/dist/astro/routes/api/widget-areas/index.mjs +32 -28
  211. package/dist/astro/routes/api/widget-components.mjs +2 -2
  212. package/dist/astro/routes/robots.txt.mjs +8 -7
  213. package/dist/astro/routes/sitemap-_collection_.xml.mjs +23 -14
  214. package/dist/astro/routes/sitemap.xml.mjs +9 -8
  215. package/dist/astro/session-driver.d.mts +1 -1
  216. package/dist/astro/session-driver.mjs +2 -2
  217. package/dist/astro/types.d.mts +22 -13
  218. package/dist/{audit-BeNsSyfU.mjs → audit-B2pRxZ20.mjs} +1 -1
  219. package/dist/auth/providers/github.d.mts +1 -1
  220. package/dist/auth/providers/google.d.mts +1 -1
  221. package/dist/{auth-control-guard-Dr14I98m.mjs → auth-control-guard-D71jourk.mjs} +1 -1
  222. package/dist/{authorize-BLO0m7fW.mjs → authorize-ZXPGPwKn.mjs} +1 -1
  223. package/dist/{briefing-CkTee1ex.mjs → briefing-0rf-su3-.mjs} +90 -28
  224. package/dist/{briefing-DJX6irto.mjs → briefing-kRhegBoF.mjs} +2 -1
  225. package/dist/bundle-CEcdUa1s.mjs +602 -0
  226. package/dist/{byline-BVC1lV6G.mjs → byline-7xR185Ly.mjs} +30 -62
  227. package/dist/{byline-fields-Cj39WhXC.mjs → byline-fields-BKzA0fJU.mjs} +1 -1
  228. package/dist/{byline-fields-uJlygdzM.d.mts → byline-fields-Ckeqd1OY.d.mts} +88 -35
  229. package/dist/{byline-fields-cNrLJVRs.mjs → byline-fields-WN7RQT4q.mjs} +10 -4
  230. package/dist/{byline-registry-4v6tXMNX.mjs → byline-registry-Ba54M74c.mjs} +2 -2
  231. package/dist/{bylines-LN9XISRo.mjs → bylines-C-EL6dh3.mjs} +9 -3
  232. package/dist/{bylines-DwokOFj6.mjs → bylines-CmZFCMr0.mjs} +5 -5
  233. package/dist/{cache-Bac05gBd.mjs → cache-DkVCKGio.mjs} +2 -2
  234. package/dist/{chunks-CuUt7K50.mjs → chunks-ChGNDY8r.mjs} +1 -1
  235. package/dist/cli/index.d.mts +29 -1
  236. package/dist/cli/index.mjs +1466 -1763
  237. package/dist/cli/plugin-kit.d.mts +75 -0
  238. package/dist/cli/plugin-kit.mjs +4 -0
  239. package/dist/client/external-auth-headers.d.mts +1 -1
  240. package/dist/client/index.d.mts +27 -52
  241. package/dist/client/index.mjs +34 -6
  242. package/dist/client-factory-BDD9azPJ.mjs +233 -0
  243. package/dist/{comment-Beue8-15.mjs → comment-DFALgsJD.mjs} +13 -3
  244. package/dist/comment-reaction-C37bf99u.mjs +58 -0
  245. package/dist/{comments-DcjFIfqX.mjs → comments-B3NwDBxl.mjs} +1 -1
  246. package/dist/{content-CBxYGWfL.mjs → content-DJcAYFhz.mjs} +51 -34
  247. package/dist/content-refresh-B4ZCmxgd.mjs +1576 -0
  248. package/dist/{context-Df1xVYyr.mjs → context-DnpXcp6Y.mjs} +2 -2
  249. package/dist/{context-CQVNZaR8.mjs → context-fSCYLL3c.mjs} +125 -53
  250. package/dist/{context-route-helpers-B9wj8Rmh.mjs → context-route-helpers-CI8XzcsK.mjs} +2 -1
  251. package/dist/{cron-DxCAU_Sn.mjs → cron-B1SL_lsb.mjs} +7 -3
  252. package/dist/{dashboard-B7ZUNuyF.mjs → dashboard-D0nj5oWg.mjs} +4 -4
  253. package/dist/db/index.d.mts +3 -3
  254. package/dist/db/index.mjs +1 -1
  255. package/dist/db/libsql.d.mts +1 -1
  256. package/dist/db/postgres.d.mts +1 -1
  257. package/dist/db/sqlite.d.mts +1 -1
  258. package/dist/{device-flow-BZVGftqi.mjs → device-flow-BJe6VEhP.mjs} +5 -5
  259. package/dist/{placeholder-d54Qr_7n.mjs → enrich-Ck9tfMqe.mjs} +36 -9
  260. package/dist/{error-DCSuUAZW.mjs → error-CSVaQNZy.mjs} +5 -0
  261. package/dist/{experimental-workflows-CSMffP6q.mjs → experimental-workflows-GVhUgzEs.mjs} +1 -1
  262. package/dist/field-defs-cache-DL-T2XVS.mjs +49 -0
  263. package/dist/forgeway-seo-client-G5ddhVHd.mjs +456 -0
  264. package/dist/{fts-manager-B5l_qwrA.mjs → fts-manager-ewTGohf4.mjs} +1 -1
  265. package/dist/{hitl-requests-7NlzVeUA.mjs → hitl-requests-DEFj8e6u.mjs} +2 -2
  266. package/dist/{hitl-route-helpers-k---_H3-.mjs → hitl-route-helpers-C23JHaWz.mjs} +5 -4
  267. package/dist/import-CXXL5pip.mjs +1354 -0
  268. package/dist/index-DcnOCD1e.d.mts +375 -0
  269. package/dist/index.d.mts +15 -16
  270. package/dist/index.mjs +85 -70
  271. package/dist/{jsonld-DZ67souc.d.mts → jsonld-DzKbhRZ4.d.mts} +8 -4
  272. package/dist/{load-D9OiGr2m.mjs → load-CFtJRT3c.mjs} +1 -1
  273. package/dist/{loader--GOYux8M.mjs → loader-aWkkc1_o.mjs} +117 -31
  274. package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-uA6pRFXi.mjs} +38 -1
  275. package/dist/mcp-reviewed-executor-Dn52L_yY.mjs +558 -0
  276. package/dist/media/image-endpoint.d.mts +32 -0
  277. package/dist/media/image-endpoint.mjs +111 -0
  278. package/dist/media/index.d.mts +27 -2
  279. package/dist/media/index.mjs +5 -3
  280. package/dist/media/local-runtime.d.mts +15 -11
  281. package/dist/media/local-runtime.mjs +9 -7
  282. package/dist/{media-CbKyYukG.mjs → media-CVMOoywq.mjs} +3 -1
  283. package/dist/{media-allowlist-BYxJIcTO.mjs → media-allowlist-zDNJmXCo.mjs} +1 -1
  284. package/dist/media-url-BdoLPvg8.mjs +20 -0
  285. package/dist/{menus-C7F0sCrC.mjs → menus-CCG2z5um.mjs} +80 -15
  286. package/dist/{menus-BZbXf-ej.mjs → menus-CmyIkRG5.mjs} +19 -5
  287. package/dist/{normalize-ByemhhfW.mjs → normalize-Cyt7JdF7.mjs} +8 -1
  288. package/dist/{oauth-authorization-DF-LCsIA.mjs → oauth-authorization-B9H7X85L.mjs} +5 -5
  289. package/dist/{oauth-clients-Du-V0fEm.mjs → oauth-clients-Dwl32-Uj.mjs} +2 -2
  290. package/dist/object-cache/memory.d.mts +14 -0
  291. package/dist/object-cache/memory.mjs +55 -0
  292. package/dist/object-cache-D51qOseS.mjs +419 -0
  293. package/dist/output-DhBe5_Pi.mjs +68 -0
  294. package/dist/page/index.d.mts +10 -3
  295. package/dist/page/index.mjs +2 -2
  296. package/dist/{parse-CneSgl7-.mjs → parse-i15EFSAE.mjs} +1 -1
  297. package/dist/{parser-DxfsARXL.mjs → parser-06LLLL4E.mjs} +151 -9
  298. package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-DkWkXfDI.d.mts} +12 -4
  299. package/dist/plugin-utils.d.mts +8 -9
  300. package/dist/plugins/adapt-sandbox-entry.d.mts +8 -9
  301. package/dist/plugins/adapt-sandbox-entry.mjs +13 -2
  302. package/dist/{plugins-DzfqRREq.mjs → plugins-CPA2PtfY.mjs} +919 -66
  303. package/dist/{transport-LSdZVXHF.mjs → portable-text-BASHceim.mjs} +1 -134
  304. package/dist/portable-text-E79LyjGo.d.mts +45 -0
  305. package/dist/{preview-C-3YTX2U.mjs → preview-BjedZm8G.mjs} +4 -3
  306. package/dist/process-cache-CCDgti7j.mjs +106 -0
  307. package/dist/project-env-DKibmuP8.mjs +95 -0
  308. package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-DC2JdWeO.d.mts} +1 -1
  309. package/dist/{public-url-B4xV4rGa.d.mts → public-url-DQJCnYi9.d.mts} +1 -1
  310. package/dist/publication-authorization-RKiHXKtq.mjs +985 -0
  311. package/dist/{query-CZ3TH_Uu.mjs → query-C2U5u5_p.mjs} +11 -6
  312. package/dist/{query-Ds0EnMFX.mjs → query-DEv5x6yB.mjs} +281 -76
  313. package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-DglsAJSw.mjs} +2 -2
  314. package/dist/{redirect-CEACczxo.mjs → redirect-ubhEqQCQ.mjs} +2 -2
  315. package/dist/{redirects-ocRJmQHP.mjs → redirects-Bhpm8bRe.mjs} +35 -19
  316. package/dist/{redirects-DYj1yPxs.mjs → redirects-xs2yahLq.mjs} +47 -24
  317. package/dist/{registry-D7HACema.mjs → registry-BYYyb2tF.mjs} +148 -81
  318. package/dist/request-context.d.mts +2 -0
  319. package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CFe1tW2M.mjs} +1 -1
  320. package/dist/review-payload-BysRWpxS.mjs +111 -0
  321. package/dist/{review-requests-BW2NxY-l.mjs → review-requests-CTWGnWUt.mjs} +1 -1
  322. package/dist/review-requests-D42VEP1l.mjs +142 -0
  323. package/dist/review-route-helpers-C31vO6SI.mjs +41 -0
  324. package/dist/runner-BgmttQmD.mjs +7444 -0
  325. package/dist/{runner-09sTqtv0.d.mts → runner-D6hzs8L9.d.mts} +1 -1
  326. package/dist/runtime.d.mts +9 -10
  327. package/dist/runtime.mjs +3 -3
  328. package/dist/schema-DUtnZxjZ.mjs +8 -0
  329. package/dist/{search-Gdrqj582.mjs → search-DUKgZUlm.mjs} +5 -3
  330. package/dist/{secrets-CeGpBFV2.mjs → secrets-ZV5rd8yV.mjs} +14 -11
  331. package/dist/{sections-BOjU13Y-.mjs → sections-DvFgsnda.mjs} +2 -2
  332. package/dist/seed/index.d.mts +2 -2
  333. package/dist/seed/index.mjs +21 -18
  334. package/dist/seo/index.d.mts +1 -1
  335. package/dist/seo/index.mjs +3 -12
  336. package/dist/{seo-5lJOtB5J.mjs → seo-BLszyJxd.mjs} +22 -4
  337. package/dist/{seo-CLj8lS7Q.mjs → seo-BU8MLCS9.mjs} +5 -2
  338. package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-GnCuL1ML.mjs} +11 -3
  339. package/dist/{service-jGlhrICs.mjs → service-FL3fB0Rx.mjs} +2 -2
  340. package/dist/session-user-Ct6GBLvn.mjs +22 -0
  341. package/dist/{settings-CUXOxzsT.mjs → settings-BECcAIRH.mjs} +28 -55
  342. package/dist/{settings-DlBsT2VS.mjs → settings-EzADu-dd.mjs} +2 -2
  343. package/dist/{setup-complete-BRrdPYjZ.mjs → setup-complete-Da0axZEE.mjs} +1 -1
  344. package/dist/{site-activity-DONFrMBJ.mjs → site-activity-h8smOlYI.mjs} +1 -1
  345. package/dist/{site-context-C8Az_P_I.mjs → site-context-B8T1kpUP.mjs} +337 -530
  346. package/dist/{site-url-DIMD68go.mjs → site-url-DJEid0ml.mjs} +1 -1
  347. package/dist/stable-hash-DshcXvRE.mjs +19 -0
  348. package/dist/status-NqWOSFAD.mjs +21 -0
  349. package/dist/storage/local.d.mts +1 -1
  350. package/dist/storage/local.mjs +1 -1
  351. package/dist/storage/s3.d.mts +1 -1
  352. package/dist/storage/s3.mjs +1 -1
  353. package/dist/{taxonomies-D9Sw4wWM.mjs → taxonomies-BiM9NtgW.mjs} +36 -29
  354. package/dist/taxonomies-DSnY5nOa.mjs +443 -0
  355. package/dist/{taxonomy-B169Nm6B.mjs → taxonomy-0k_vRVsD.mjs} +44 -9
  356. package/dist/transport-C46KHLMP.mjs +134 -0
  357. package/dist/types-A8fPOJnl.mjs +69 -0
  358. package/dist/types-BLQCz46p.d.mts +118 -0
  359. package/dist/{types-CwawBUTa.d.mts → types-B_FlxIIl.d.mts} +4 -1
  360. package/dist/{types-CSgR9nQB.mjs → types-ChxYDRvx.mjs} +1 -1
  361. package/dist/{types-GaCtZ1k9.d.mts → types-Cw0PeCT_.d.mts} +18 -0
  362. package/dist/types-DuQn1G7-.d.mts +2973 -0
  363. package/dist/{runtime-C4-2lSFg.d.mts → types-DwoUifGE.d.mts} +5668 -3000
  364. package/dist/{types-DRIKLmJI.d.mts → types-opjX_kz6.d.mts} +17 -2
  365. package/dist/ui/server-runtime.d.mts +13 -15
  366. package/dist/ui/server-runtime.mjs +24 -20
  367. package/dist/url-guoXQQcV.mjs +33 -0
  368. package/dist/{user-DTLoZs16.mjs → user-BH-n01y3.mjs} +2 -2
  369. package/dist/{utils-B8hBJ9Oz.mjs → utils-D1SrKGtP.mjs} +129 -7
  370. package/dist/{validate-DzjCdy6v.d.mts → validate-CbVFoJgc.d.mts} +65 -8
  371. package/dist/{validate-DWmPO6oj.mjs → validate-D1HL-oLR.mjs} +11 -6
  372. package/dist/version-C3iVRuaF.mjs +6 -0
  373. package/dist/{widgets-BpJ8EpPd.mjs → widgets-BZrLrNgS.mjs} +46 -43
  374. package/dist/{wordpress-slugs-DHNR9LpG.mjs → wordpress-slugs-C3PWcowq.mjs} +1 -1
  375. package/dist/{zod-generator-K91-g665.mjs → zod-generator-C7AsLpSB.mjs} +42 -14
  376. package/package.json +38 -8
  377. package/src/components/Block.astro +50 -0
  378. package/src/components/Comments.astro +143 -1
  379. package/src/components/DinewayHead.astro +19 -2
  380. package/src/components/DinewayImage.astro +66 -33
  381. package/src/components/DinewayMedia.astro +1 -2
  382. package/src/components/Image.astro +85 -40
  383. package/src/components/InlinePortableTextEditor.tsx +12 -2
  384. package/src/components/JsonLdScript.astro +9 -0
  385. package/src/components/LiveSearch.astro +40 -4
  386. package/src/components/index.ts +4 -0
  387. package/src/components/live-search-routing.ts +30 -0
  388. package/src/components/portable-text-text-align.ts +15 -0
  389. package/src/ui.ts +2 -0
  390. package/dist/entity-aliases-4y93Yjuc.mjs +0 -51
  391. package/dist/import-4YBXbDkI.mjs +0 -684
  392. package/dist/index-CZiWCQDp.d.mts +0 -227
  393. package/dist/review-requests-Qum4713s.mjs +0 -79
  394. package/dist/runner-DzIpHGND.mjs +0 -2836
  395. package/dist/schema-Bsi-VpYv.mjs +0 -8
  396. package/dist/taxonomies-CZ-_DitR.mjs +0 -327
  397. package/dist/types-CuJOqHfM.d.mts +0 -758
  398. package/dist/types-DSPGWjxO.d.mts +0 -1247
  399. package/dist/types-nP9vGUFq.d.mts +0 -56
  400. package/dist/version-C4gfn0PJ.mjs +0 -6
  401. /package/dist/{adapters-OQCImOL7.d.mts → adapters-BiRymx02.d.mts} +0 -0
  402. /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-Ypaly90d.mjs} +0 -0
  403. /package/dist/{challenge-store-DFxX0_15.mjs → challenge-store-D5pSY2S1.mjs} +0 -0
  404. /package/dist/{components--pg6zBvu.mjs → components-DImzlLhb.mjs} +0 -0
  405. /package/dist/{context-types-r8oFvyOq.mjs → context-types-eBuMDAg-.mjs} +0 -0
  406. /package/dist/{default-B6iaLvP7.mjs → default-D4Vygcy_.mjs} +0 -0
  407. /package/dist/{email-console-BOVqIYpB.mjs → email-console-Bp0r68iF.mjs} +0 -0
  408. /package/dist/{escape-BDgouFFY.mjs → escape-DN4Qmjsl.mjs} +0 -0
  409. /package/dist/{hash-BPmX6P8I.mjs → hash-mxxx2oPW.mjs} +0 -0
  410. /package/dist/{mime-CbKsKDCB.mjs → mime-C0vOHFm7.mjs} +0 -0
  411. /package/dist/{mode-CZqCF9dZ.mjs → mode-C8yZnIlR.mjs} +0 -0
  412. /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CndT35iw.mjs} +0 -0
  413. /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-CMehAaKs.mjs} +0 -0
  414. /package/dist/{options-LsPjZlqD.mjs → options-DQPTH5n0.mjs} +0 -0
  415. /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-NYukYGed.mjs} +0 -0
  416. /package/dist/{patterns-DKAX6oqN.mjs → patterns-CoqlXUvk.mjs} +0 -0
  417. /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-BtfrrzfD.mjs} +0 -0
  418. /package/dist/{public-url-B_m9IwdV.mjs → public-url-Cp6hyjVR.mjs} +0 -0
  419. /package/dist/{redirect-BjIBtDWY.mjs → redirect-DrbEmU9a.mjs} +0 -0
  420. /package/dist/{request-cache-ho99schz.mjs → request-cache-CBFjCwSt.mjs} +0 -0
  421. /package/dist/{resolve-DTuDyYKs.mjs → resolve-DE71WcL9.mjs} +0 -0
  422. /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-BtkKnvxQ.mjs} +0 -0
  423. /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-Ctzfyyp-.mjs} +0 -0
  424. /package/dist/{slugify-BqebcqBg.mjs → slugify-KSsVD_D3.mjs} +0 -0
  425. /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-FJqwQzj4.mjs} +0 -0
  426. /package/dist/{tokens-SLmgowfd.mjs → tokens-BDQU29Vd.mjs} +0 -0
  427. /package/dist/{transaction-CFLhEOuH.mjs → transaction-0LEAAy8R.mjs} +0 -0
  428. /package/dist/{transport-BnsNxh2l.d.mts → transport-D9pKAzFP.d.mts} +0 -0
  429. /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-Dm7Mxvt6.mjs} +0 -0
  430. /package/dist/{types-CJ8DkL0q.mjs → types-B7TDDFMG.mjs} +0 -0
  431. /package/dist/{types-Dryvv7LH.d.mts → types-g0zMtraY.d.mts} +0 -0
  432. /package/dist/{types-Cg276-3z.mjs → types-mVVgRPaU.mjs} +0 -0
  433. /package/dist/{types-DZpT-PnG.d.mts → types-wFu80FrO.d.mts} +0 -0
  434. /package/dist/{url-w7Mp5qAD.mjs → url-EMAguGVk.mjs} +0 -0
@@ -1,81 +1,96 @@
1
- import { i as runMigrations } from "../runner-DzIpHGND.mjs";
1
+ import { i as runMigrations } from "../runner-BgmttQmD.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-DzfqRREq.mjs";
6
+ import { _ as DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES, d as EmailPipeline, g as definePlugin, h as runPluginMigrations, m as resolveExclusiveHooks, p as createHookPipeline, u as PluginRouteRegistry, v as readBoundedPluginRouteBody } from "../plugins-CPA2PtfY.mjs";
7
7
  import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
8
8
  import { createRecorder, flushRecorder, formatServerTimingHeader, isInstrumentationEnabled, isServerTimingEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
9
9
  import "../base64-F8-DUraK.mjs";
10
- import "../types-CSgR9nQB.mjs";
11
- import { a as isMissingTableError, r as getDb } from "../loader--GOYux8M.mjs";
12
- import { r as RevisionRepository, t as ContentRepository } from "../content-CBxYGWfL.mjs";
13
- import { t as MediaRepository } from "../media-CbKyYukG.mjs";
14
- import "../user-DTLoZs16.mjs";
15
- import "../taxonomy-B169Nm6B.mjs";
16
- import "../comment-Beue8-15.mjs";
17
- import { t as OptionsRepository } from "../options-LsPjZlqD.mjs";
18
- import "../audit-BeNsSyfU.mjs";
19
- import "../site-activity-DONFrMBJ.mjs";
20
- import "../review-requests-BW2NxY-l.mjs";
21
- import "../entity-aliases-4y93Yjuc.mjs";
22
- import "../context-CQVNZaR8.mjs";
23
- import "../menus-BZbXf-ej.mjs";
24
- import "../redirect-CEACczxo.mjs";
25
- import { r as requestCached } from "../request-cache-ho99schz.mjs";
26
- import "../byline-registry-4v6tXMNX.mjs";
27
- import "../byline-BVC1lV6G.mjs";
28
- import { n as normalizeMediaValue } from "../normalize-ByemhhfW.mjs";
29
- import "../placeholder-d54Qr_7n.mjs";
30
- import "../seo-CLj8lS7Q.mjs";
31
- 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-BMIxRIEN.mjs";
32
- import "../dashboard-B7ZUNuyF.mjs";
33
- import { u as PluginStateRepository } from "../briefing-CkTee1ex.mjs";
34
- import "../context-types-r8oFvyOq.mjs";
35
- import { t as FTSManager } from "../fts-manager-B5l_qwrA.mjs";
36
- import { n as SchemaRegistry } from "../registry-D7HACema.mjs";
37
- import { c as createPublicMediaUrlResolver } from "../settings-CUXOxzsT.mjs";
38
- import "../briefing-DJX6irto.mjs";
39
- import "../review-requests-Qum4713s.mjs";
40
- import { n as hashString } from "../hash-BPmX6P8I.mjs";
41
- import { n as VERSION, t as COMMIT } from "../version-C4gfn0PJ.mjs";
42
- import "../query-CZ3TH_Uu.mjs";
43
- import "../zod-generator-K91-g665.mjs";
44
- import "../schema-Bsi-VpYv.mjs";
45
- import "../seo-5lJOtB5J.mjs";
46
- import "../bylines-LN9XISRo.mjs";
47
- import "../byline-fields-Cj39WhXC.mjs";
48
- import "../sections-BOjU13Y-.mjs";
49
- import "../settings-DlBsT2VS.mjs";
50
- import "../resolve-DTuDyYKs.mjs";
51
- import "../taxonomies-CZ-_DitR.mjs";
52
- import "../taxonomies-D9Sw4wWM.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-cNrLJVRs.mjs";
57
- import { a as invalidateUrlPatternCache } from "../query-Ds0EnMFX.mjs";
58
- import "../preview-C-3YTX2U.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-4YBXbDkI.mjs";
66
- import "../utils-B8hBJ9Oz.mjs";
67
- import "../tokens-SLmgowfd.mjs";
68
- import "../menus-C7F0sCrC.mjs";
69
- import "../bylines-DwokOFj6.mjs";
70
- import "../widgets-BpJ8EpPd.mjs";
71
- import "../apply-D_RlTYtC.mjs";
72
- import "../load-D9OiGr2m.mjs";
73
- import "../search-Gdrqj582.mjs";
10
+ import "../types-ChxYDRvx.mjs";
11
+ import { o as isMissingTableError, r as getDb } from "../loader-aWkkc1_o.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-DJcAYFhz.mjs";
15
+ import { t as MediaRepository } from "../media-CVMOoywq.mjs";
16
+ import "../user-BH-n01y3.mjs";
17
+ import "../taxonomy-0k_vRVsD.mjs";
18
+ import "../comment-DFALgsJD.mjs";
19
+ import { t as OptionsRepository } from "../options-DQPTH5n0.mjs";
20
+ import "../audit-B2pRxZ20.mjs";
21
+ import "../site-activity-h8smOlYI.mjs";
22
+ import "../review-requests-CTWGnWUt.mjs";
23
+ import { n as PublicationAuthorizationService, t as PublicationAuthorizationError } from "../publication-authorization-RKiHXKtq.mjs";
24
+ import "../site-context-B8T1kpUP.mjs";
25
+ import { t as PluginContextFactory } from "../context-fSCYLL3c.mjs";
26
+ import "../menus-CmyIkRG5.mjs";
27
+ import "../redirect-ubhEqQCQ.mjs";
28
+ import { r as requestCached } from "../request-cache-CBFjCwSt.mjs";
29
+ import "../byline-registry-Ba54M74c.mjs";
30
+ import { a as initWithLock, i as createInitLock, r as processCachedAsync, t as createProcessCache } from "../process-cache-CCDgti7j.mjs";
31
+ import "../field-defs-cache-DL-T2XVS.mjs";
32
+ import "../byline-7xR185Ly.mjs";
33
+ import { n as normalizeMediaValue } from "../normalize-Cyt7JdF7.mjs";
34
+ import "../enrich-Ck9tfMqe.mjs";
35
+ import "../seo-BU8MLCS9.mjs";
36
+ 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-B4PHIF4V.mjs";
37
+ import "../dashboard-D0nj5oWg.mjs";
38
+ import { u as PluginStateRepository } from "../briefing-0rf-su3-.mjs";
39
+ import "../context-types-eBuMDAg-.mjs";
40
+ import { i as markContentMediaUsageCollectionStale, o as refreshContentMediaUsageAfterWrite, r as findNonTranslatableSiblingContentIds, t as deleteContentMediaUsage } from "../content-refresh-B4ZCmxgd.mjs";
41
+ import { n as hashString } from "../hash-mxxx2oPW.mjs";
42
+ import { t as FTSManager } from "../fts-manager-ewTGohf4.mjs";
43
+ import { n as SchemaRegistry } from "../registry-BYYyb2tF.mjs";
44
+ import { r as createPublicMediaUrlResolver } from "../url-guoXQQcV.mjs";
45
+ import "../settings-BECcAIRH.mjs";
46
+ import "../briefing-kRhegBoF.mjs";
47
+ import "../review-requests-D42VEP1l.mjs";
48
+ import { n as VERSION, t as COMMIT } from "../version-C3iVRuaF.mjs";
49
+ import "../query-C2U5u5_p.mjs";
50
+ import "../zod-generator-C7AsLpSB.mjs";
51
+ import "../schema-DUtnZxjZ.mjs";
52
+ import "../seo-BLszyJxd.mjs";
53
+ import "../bylines-C-EL6dh3.mjs";
54
+ import "../byline-fields-BKzA0fJU.mjs";
55
+ import "../sections-DvFgsnda.mjs";
56
+ import "../settings-EzADu-dd.mjs";
57
+ import "../resolve-DE71WcL9.mjs";
58
+ import "../taxonomies-DSnY5nOa.mjs";
59
+ import "../taxonomies-BiM9NtgW.mjs";
60
+ import { r as normalizeManifestRoute } from "../manifest-schema-uA6pRFXi.mjs";
61
+ import "../parse-i15EFSAE.mjs";
62
+ import "../redirects-Bhpm8bRe.mjs";
63
+ import "../byline-fields-WN7RQT4q.mjs";
64
+ import "../status-NqWOSFAD.mjs";
65
+ import { t as getTrustedProxyHeaders } from "../trusted-proxy-Dm7Mxvt6.mjs";
66
+ import "../rate-limit-DglsAJSw.mjs";
67
+ import { a as invalidateUrlPatternCache } from "../query-DEv5x6yB.mjs";
68
+ import "../preview-BjedZm8G.mjs";
69
+ import "../parser-06LLLL4E.mjs";
70
+ import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-CFe1tW2M.mjs";
71
+ import "../ssrf-FJqwQzj4.mjs";
72
+ import { n as CronExecutor } from "../cron-B1SL_lsb.mjs";
73
+ import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-Bp0r68iF.mjs";
74
+ import { o as validateEncryptionKeyAtStartup } from "../secrets-ZV5rd8yV.mjs";
75
+ import "../api-tokens-Ypaly90d.mjs";
76
+ import { n as createActivePluginMcpRegistry } from "../mcp-reviewed-executor-Dn52L_yY.mjs";
77
+ import "../activity-DUaz_w7p.mjs";
78
+ import "../activity-events-CJDvE2uc.mjs";
79
+ import { i as experimentalSiteContextWorkflowsEnabled } from "../experimental-workflows-GVhUgzEs.mjs";
80
+ import "../utils-D1SrKGtP.mjs";
81
+ import "../search-DUKgZUlm.mjs";
82
+ import "../import-CXXL5pip.mjs";
83
+ import "../tokens-BDQU29Vd.mjs";
84
+ import "../comment-reaction-C37bf99u.mjs";
85
+ import "../menus-CCG2z5um.mjs";
86
+ import "../bylines-CmZFCMr0.mjs";
87
+ import "../widgets-BZrLrNgS.mjs";
88
+ import "../apply-DjTqq6Ae.mjs";
89
+ import "../load-CFtJRT3c.mjs";
74
90
  import "../index.mjs";
75
- import { t as getAuthMode } from "../mode-CZqCF9dZ.mjs";
76
- import { i as experimentalSiteContextWorkflowsEnabled } from "../experimental-workflows-CSMffP6q.mjs";
77
- import { t as cleanupExpiredChallenges } from "../challenge-store-DFxX0_15.mjs";
78
- import { a as validateEncryptionKeyAtStartup } from "../secrets-CeGpBFV2.mjs";
91
+ import { t as getAuthMode } from "../mode-C8yZnIlR.mjs";
92
+ import { t as cleanupExpiredChallenges } from "../challenge-store-D5pSY2S1.mjs";
93
+ import { t as resolveSessionUser } from "../session-user-Ct6GBLvn.mjs";
79
94
  import { Kysely, sql } from "kysely";
80
95
  import { defineMiddleware } from "astro:middleware";
81
96
  import virtualConfig from "virtual:dineway/config";
@@ -348,6 +363,10 @@ const SCHEDULED_PUBLISH_BATCH_LIMIT = 100;
348
363
  async function publishDueContent(db, options = {}) {
349
364
  const { publish, onPublished, limit = SCHEDULED_PUBLISH_BATCH_LIMIT } = options;
350
365
  const published = [];
366
+ if (!publish) {
367
+ console.error("[scheduled-publish] Authorized publication callback is required");
368
+ return published;
369
+ }
351
370
  let collections;
352
371
  try {
353
372
  collections = await new SchemaRegistry(db).listCollections();
@@ -356,22 +375,27 @@ async function publishDueContent(db, options = {}) {
356
375
  return published;
357
376
  }
358
377
  const repo = new ContentRepository(db);
359
- const doPublish = publish ?? ((collection, id, opts) => handleContentPublish(db, collection, id, opts));
360
378
  const batchLimit = limit > 0 ? limit : void 0;
361
379
  for (const collection of collections) try {
362
380
  const due = await repo.findReadyToPublish(collection.slug, batchLimit);
363
381
  const batch = [];
364
382
  for (const item of due) {
383
+ if (!item.scheduledAt) continue;
365
384
  const publishedAt = item.publishedAt == null ? item.scheduledAt ?? void 0 : void 0;
366
- const result = await doPublish(collection.slug, item.id, {
367
- publishedAt,
368
- requireScheduledDue: true
369
- });
370
- if (result.success) batch.push({
371
- collection: collection.slug,
372
- id: item.id
373
- });
374
- else if (result.error?.code !== "NOT_DUE") console.error(`[scheduled-publish] Failed to publish ${collection.slug}/${item.id}:`, result.error);
385
+ try {
386
+ const result = await publish(collection.slug, item.id, {
387
+ publishedAt,
388
+ requireScheduledDue: true,
389
+ scheduledAt: item.scheduledAt
390
+ });
391
+ if (result.success) batch.push({
392
+ collection: collection.slug,
393
+ id: item.id
394
+ });
395
+ else if (result.error?.code !== "NOT_DUE") console.error(`[scheduled-publish] Failed to publish ${collection.slug}/${item.id}:`, result.error);
396
+ } catch (error) {
397
+ console.error(`[scheduled-publish] Failed to publish ${collection.slug}/${item.id}:`, error);
398
+ }
375
399
  }
376
400
  if (batch.length > 0) {
377
401
  published.push(...batch);
@@ -387,47 +411,6 @@ async function publishDueContent(db, options = {}) {
387
411
  return published;
388
412
  }
389
413
 
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
414
  //#endregion
432
415
  //#region src/dineway-runtime.ts
433
416
  const LEADING_SLASH_PATTERN = /^\//;
@@ -553,7 +536,6 @@ var DinewayRuntime = class DinewayRuntime {
553
536
  configuredPlugins;
554
537
  sandboxedPlugins;
555
538
  sandboxedPluginEntries;
556
- schemaRegistry;
557
539
  _hooks;
558
540
  config;
559
541
  mediaProviders;
@@ -576,10 +558,8 @@ var DinewayRuntime = class DinewayRuntime {
576
558
  runtimeDeps;
577
559
  /** Mutable ref for the cron invokeCronHook closure to read the current pipeline */
578
560
  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;
561
+ /** Process-lifetime FTS health check cache that never stores an in-flight promise. */
562
+ _searchHealthCache = createProcessCache();
583
563
  /**
584
564
  * Get the database instance for the current request.
585
565
  *
@@ -599,7 +579,6 @@ var DinewayRuntime = class DinewayRuntime {
599
579
  this.configuredPlugins = configuredPlugins;
600
580
  this.sandboxedPlugins = sandboxedPlugins;
601
581
  this.sandboxedPluginEntries = sandboxedPluginEntries;
602
- this.schemaRegistry = new SchemaRegistry(db);
603
582
  this._hooks = hooks;
604
583
  this.enabledPlugins = enabledPlugins;
605
584
  this.pluginStates = pluginStates;
@@ -620,12 +599,53 @@ var DinewayRuntime = class DinewayRuntime {
620
599
  getSandboxRunner() {
621
600
  return sandboxRunner;
622
601
  }
602
+ get schemaRegistry() {
603
+ return new SchemaRegistry(this.db);
604
+ }
605
+ /**
606
+ * Resolve native MCP contributions from the current active plugin set.
607
+ * The registry is derived per request so activate/deactivate changes cannot
608
+ * leave a stateless MCP server with a stale contribution snapshot.
609
+ */
610
+ getPluginMcpRegistry() {
611
+ return createActivePluginMcpRegistry(this.configuredPlugins, this.enabledPlugins);
612
+ }
613
+ /**
614
+ * Resolve the outbound HTTP capability for an active native plugin.
615
+ * MCP handlers use this instead of reaching for global fetch, so the same
616
+ * capability and SSRF rules apply to routes, hooks, and MCP contributions.
617
+ */
618
+ getPluginHttpAccess(pluginId) {
619
+ if (!this.enabledPlugins.has(pluginId)) return void 0;
620
+ const plugin = this.configuredPlugins.find((candidate) => candidate.id === pluginId);
621
+ if (!plugin) return void 0;
622
+ return new PluginContextFactory({
623
+ ...this.pipelineFactoryOptions,
624
+ emailPipeline: this.email ?? void 0,
625
+ cronReschedule: this.cronScheduler ? () => this.cronScheduler?.reschedule() : void 0
626
+ }).createContext(plugin).http;
627
+ }
623
628
  /**
624
629
  * Publish any content whose scheduled time has passed.
625
630
  * Routes through the runtime wrapper so after-publish hooks still fire.
626
631
  */
627
632
  async publishScheduled() {
628
- return publishDueContent(this.db, { publish: (collection, id, options) => this.handleContentPublish(collection, id, options) });
633
+ return publishDueContent(this.db, { publish: this.publishAuthorizedDueContent.bind(this) });
634
+ }
635
+ async publishAuthorizedDueContent(collection, id, options) {
636
+ try {
637
+ return (await this.createPublicationAuthorizationService().publishAuthorizedDueContent({
638
+ collection,
639
+ id,
640
+ scheduledAt: options.scheduledAt,
641
+ publishedAt: options.publishedAt
642
+ })).result;
643
+ } catch (error) {
644
+ return {
645
+ success: false,
646
+ error: { code: error instanceof PublicationAuthorizationError ? error.code : "SCHEDULED_PUBLISH_ERROR" }
647
+ };
648
+ }
629
649
  }
630
650
  /**
631
651
  * Run all scheduled maintenance work from a heartbeat driver.
@@ -646,7 +666,7 @@ var DinewayRuntime = class DinewayRuntime {
646
666
  let published = [];
647
667
  try {
648
668
  published = await publishDueContent(this.db, {
649
- publish: (collection, id, opts) => this.handleContentPublish(collection, id, opts),
669
+ publish: this.publishAuthorizedDueContent.bind(this),
650
670
  onPublished: options.onPublished
651
671
  });
652
672
  } catch (error) {
@@ -679,26 +699,29 @@ var DinewayRuntime = class DinewayRuntime {
679
699
  *
680
700
  * Search health is deferred off the runtime cold-start path so ordinary
681
701
  * 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.
702
+ * coalesce without sharing an in-flight promise, and once it has completed
703
+ * the result is treated as healthy for the lifetime of this runtime instance.
684
704
  */
685
705
  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 () => {
706
+ const requestDb = getRequestContextDatabase();
707
+ const db = requestDb ?? this._db;
708
+ if (!isSqlite(db)) return;
709
+ const verify = async () => {
693
710
  try {
694
- const repaired = await new FTSManager(this.db).verifyAndRepairAll();
711
+ const repaired = await new FTSManager(db).verifyAndRepairAll();
695
712
  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;
713
+ } catch {}
714
+ };
715
+ if (requestDb) {
716
+ await verify();
717
+ return;
718
+ }
719
+ try {
720
+ await processCachedAsync(this._searchHealthCache, verify, {
721
+ anchor: (promise) => after(() => promise),
722
+ ownerTimeoutMs: 3e4
723
+ });
724
+ } catch {}
702
725
  }
703
726
  /**
704
727
  * Update in-memory plugin status and rebuild the hook pipeline.
@@ -731,10 +754,7 @@ var DinewayRuntime = class DinewayRuntime {
731
754
  async rebuildHookPipeline() {
732
755
  const newPipeline = createHookPipeline(this.allPipelinePlugins.filter((p) => this.enabledPlugins.has(p.id)), this.pipelineFactoryOptions);
733
756
  await DinewayRuntime.resolveExclusiveHooks(newPipeline, this.db, this.runtimeDeps);
734
- if (this.email) newPipeline.setContextFactory({
735
- db: this.db,
736
- emailPipeline: this.email
737
- });
757
+ if (this.email) newPipeline.setContextFactory({ emailPipeline: this.email });
738
758
  if (this.cronScheduler) {
739
759
  const scheduler = this.cronScheduler;
740
760
  newPipeline.setContextFactory({ cronReschedule: () => scheduler.reschedule() });
@@ -816,7 +836,10 @@ var DinewayRuntime = class DinewayRuntime {
816
836
  const routeMetaMap = /* @__PURE__ */ new Map();
817
837
  for (const entry of bundle.manifest.routes) {
818
838
  const normalized = normalizeManifestRoute(entry);
819
- routeMetaMap.set(normalized.name, { public: normalized.public === true });
839
+ routeMetaMap.set(normalized.name, {
840
+ public: normalized.public === true,
841
+ body: "json"
842
+ });
820
843
  }
821
844
  sandboxedRouteMetaCache.set(pluginId, routeMetaMap);
822
845
  } else sandboxedRouteMetaCache.delete(pluginId);
@@ -843,6 +866,8 @@ var DinewayRuntime = class DinewayRuntime {
843
866
  }
844
867
  };
845
868
  const db = await phase("rt.db", "DB init + migrations", () => DinewayRuntime.getDatabase(deps));
869
+ const resolveDb = () => getRequestContextDatabase() ?? db;
870
+ await phase("rt.plugin-migrations", "Trusted plugin migrations", () => runPluginMigrations(db, deps.plugins));
846
871
  await phase("rt.secrets", "Validate encryption key", () => validateEncryptionKeyAtStartup());
847
872
  const storage = DinewayRuntime.getStorage(deps);
848
873
  let pluginStates = /* @__PURE__ */ new Map();
@@ -906,6 +931,7 @@ var DinewayRuntime = class DinewayRuntime {
906
931
  const trustedProxyHeaders = getTrustedProxyHeaders(deps.config);
907
932
  const pipelineFactoryOptions = {
908
933
  db,
934
+ getDb: resolveDb,
909
935
  storage: storage ?? void 0,
910
936
  siteInfo,
911
937
  trustedProxyHeaders
@@ -924,6 +950,7 @@ var DinewayRuntime = class DinewayRuntime {
924
950
  const mediaProviderEntries = deps.mediaProviderEntries ?? [];
925
951
  const providerContext = {
926
952
  db,
953
+ getDb: resolveDb,
927
954
  storage
928
955
  };
929
956
  for (const entry of mediaProviderEntries) try {
@@ -940,15 +967,12 @@ var DinewayRuntime = class DinewayRuntime {
940
967
  const result = await pipelineRef.current.invokeCronHook(pluginId, event);
941
968
  if (!result.success && result.error) throw result.error;
942
969
  };
943
- pipeline.setContextFactory({
944
- db,
945
- emailPipeline
946
- });
970
+ pipeline.setContextFactory({ emailPipeline });
947
971
  let cronExecutor = null;
948
972
  const runtimeRef = { current: null };
949
973
  await phase("rt.cron", "Cron init (recovery deferred post-response)", async () => {
950
974
  try {
951
- cronExecutor = new CronExecutor(db, invokeCronHook);
975
+ cronExecutor = new CronExecutor(resolveDb, invokeCronHook);
952
976
  const executorForRecovery = cronExecutor;
953
977
  after(async () => {
954
978
  try {
@@ -963,7 +987,7 @@ var DinewayRuntime = class DinewayRuntime {
963
987
  cronScheduler.setSystemCleanup(async () => {
964
988
  try {
965
989
  const runtime = runtimeRef.current;
966
- await publishDueContent(db, { publish: runtime ? (collection, id, options) => runtime.handleContentPublish(collection, id, options) : void 0 });
990
+ await publishDueContent(db, { publish: runtime ? runtime.publishAuthorizedDueContent.bind(runtime) : void 0 });
967
991
  } catch (error) {
968
992
  console.error("[scheduled-publish] Sweep failed:", error);
969
993
  }
@@ -979,6 +1003,18 @@ var DinewayRuntime = class DinewayRuntime {
979
1003
  console.warn("[cron] Failed to initialize cron system:", error);
980
1004
  }
981
1005
  });
1006
+ await phase("rt.pluginLifecycle", "Configured plugin first-start lifecycle", async () => {
1007
+ const stateRepository = new PluginStateRepository(db);
1008
+ for (const plugin of deps.plugins) {
1009
+ if (pluginStates.has(plugin.id)) continue;
1010
+ const installFailure = (await pipeline.runPluginInstall(plugin.id)).find((result) => !result.success);
1011
+ if (installFailure) throw new Error(`Plugin install failed for "${plugin.id}": ${installFailure.error?.message ?? "Unknown error"}`);
1012
+ const activateFailure = (await pipeline.runPluginActivate(plugin.id)).find((result) => !result.success);
1013
+ if (activateFailure) throw new Error(`Plugin activation failed for "${plugin.id}": ${activateFailure.error?.message ?? "Unknown error"}`);
1014
+ await stateRepository.enable(plugin.id, plugin.version);
1015
+ pluginStates.set(plugin.id, "active");
1016
+ }
1017
+ });
982
1018
  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
1019
  runtimeRef.current = runtime;
984
1020
  return runtime;
@@ -1030,9 +1066,9 @@ var DinewayRuntime = class DinewayRuntime {
1030
1066
  }
1031
1067
  })();
1032
1068
  if (collectionCount.count === 0 && !setupDone) {
1033
- const { applySeed } = await import("../apply-D_RlTYtC.mjs").then((n) => n.n);
1034
- const { loadSeed } = await import("../load-D9OiGr2m.mjs").then((n) => n.r);
1035
- const { validateSeed } = await import("../validate-DWmPO6oj.mjs").then((n) => n.n);
1069
+ const { applySeed } = await import("../apply-DjTqq6Ae.mjs").then((n) => n.n);
1070
+ const { loadSeed } = await import("../load-CFtJRT3c.mjs").then((n) => n.r);
1071
+ const { validateSeed } = await import("../validate-D1HL-oLR.mjs").then((n) => n.n);
1036
1072
  const seed = await loadSeed();
1037
1073
  if (validateSeed(seed).valid) {
1038
1074
  await applySeed(db, seed, { onConflict: "skip" });
@@ -1130,7 +1166,10 @@ var DinewayRuntime = class DinewayRuntime {
1130
1166
  const routeMeta = /* @__PURE__ */ new Map();
1131
1167
  for (const entry of bundle.manifest.routes) {
1132
1168
  const normalized = normalizeManifestRoute(entry);
1133
- routeMeta.set(normalized.name, { public: normalized.public === true });
1169
+ routeMeta.set(normalized.name, {
1170
+ public: normalized.public === true,
1171
+ body: "json"
1172
+ });
1134
1173
  }
1135
1174
  sandboxedRouteMetaCache.set(plugin.pluginId, routeMeta);
1136
1175
  }
@@ -1238,7 +1277,9 @@ var DinewayRuntime = class DinewayRuntime {
1238
1277
  sandboxed: true,
1239
1278
  adminMode: hasAdminPages || hasWidgets ? "blocks" : "none",
1240
1279
  adminPages: entry.adminPages ?? [],
1241
- dashboardWidgets: entry.adminWidgets ?? []
1280
+ dashboardWidgets: entry.adminWidgets ?? [],
1281
+ portableTextBlocks: entry.portableTextBlocks,
1282
+ fieldWidgets: entry.fieldWidgets
1242
1283
  };
1243
1284
  }
1244
1285
  for (const [pluginId, meta] of marketplaceManifestCache) {
@@ -1318,11 +1359,13 @@ var DinewayRuntime = class DinewayRuntime {
1318
1359
  authorId: body.authorId,
1319
1360
  bylines: body.bylines
1320
1361
  });
1321
- if (result.success && result.data) this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, true);
1362
+ if (result.success && result.data) {
1363
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1364
+ this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, true);
1365
+ }
1322
1366
  return result;
1323
1367
  }
1324
1368
  async handleContentUpdate(collection, id, body) {
1325
- const { ContentRepository } = await import("../content-CBxYGWfL.mjs").then((n) => n.n);
1326
1369
  const repo = new ContentRepository(this.db);
1327
1370
  const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
1328
1371
  const resolvedId = resolvedItem?.id ?? id;
@@ -1393,7 +1436,21 @@ var DinewayRuntime = class DinewayRuntime {
1393
1436
  authorId: bodyWithoutRev.authorId,
1394
1437
  bylines: bodyWithoutRev.bylines
1395
1438
  });
1396
- if (result.success && result.data) this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, false);
1439
+ if (result.success && result.data) {
1440
+ const contentIdsToRefresh = [resolvedId];
1441
+ if (!usesDraftRevisions && processedData) try {
1442
+ contentIdsToRefresh.push(...await findNonTranslatableSiblingContentIds(this.db, collection, resolvedId, result.data.item.translationGroup, processedData));
1443
+ } catch (error) {
1444
+ console.error(`[media-usage] Failed to discover synced i18n siblings for ${collection}/${resolvedId}:`, error);
1445
+ try {
1446
+ await markContentMediaUsageCollectionStale(this.db, collection, "CONTENT_USAGE_REFRESH_ERROR");
1447
+ } catch (staleError) {
1448
+ console.error(`[media-usage] Failed to mark ${collection} stale:`, staleError);
1449
+ }
1450
+ }
1451
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, contentIdsToRefresh);
1452
+ this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, false);
1453
+ }
1397
1454
  return result;
1398
1455
  }
1399
1456
  async handleContentDelete(collection, id) {
@@ -1414,48 +1471,95 @@ var DinewayRuntime = class DinewayRuntime {
1414
1471
  message: "Delete blocked by sandboxed plugin hook"
1415
1472
  }
1416
1473
  };
1474
+ const contentId = await this.resolveContentId(collection, id, false);
1417
1475
  const result = await handleContentDelete(this.db, collection, id);
1418
- if (result.success) this.runAfterDeleteHooks(id, collection, false);
1476
+ if (result.success) {
1477
+ if (contentId) await this.refreshContentUsageAfterSuccessfulWrite(collection, [contentId]);
1478
+ this.runAfterDeleteHooks(id, collection, false);
1479
+ }
1419
1480
  return result;
1420
1481
  }
1421
1482
  async handleContentListTrashed(collection, params = {}) {
1422
1483
  return handleContentListTrashed(this.db, collection, params);
1423
1484
  }
1424
1485
  async handleContentRestore(collection, id) {
1425
- return handleContentRestore(this.db, collection, id);
1486
+ const result = await handleContentRestore(this.db, collection, id);
1487
+ if (result.success) {
1488
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1489
+ this.runAfterRestoreHooks(contentItemToRecord(result.data.item), collection);
1490
+ }
1491
+ return result;
1426
1492
  }
1427
1493
  async handleContentPermanentDelete(collection, id) {
1494
+ const contentId = await this.resolveContentId(collection, id, true);
1428
1495
  const result = await handleContentPermanentDelete(this.db, collection, id);
1429
- if (result.success) this.runAfterDeleteHooks(id, collection, true);
1496
+ if (result.success) {
1497
+ if (contentId) await this.deleteContentUsageAfterSuccessfulPermanentDelete(collection, contentId);
1498
+ this.runAfterDeleteHooks(id, collection, true);
1499
+ }
1430
1500
  return result;
1431
1501
  }
1432
1502
  async handleContentCountTrashed(collection) {
1433
1503
  return handleContentCountTrashed(this.db, collection);
1434
1504
  }
1435
1505
  async handleContentDuplicate(collection, id, authorId) {
1436
- return handleContentDuplicate(this.db, collection, id, authorId);
1506
+ const result = await handleContentDuplicate(this.db, collection, id, authorId);
1507
+ if (result.success && result.data) await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1508
+ return result;
1509
+ }
1510
+ createPublicationAuthorizationService() {
1511
+ const policies = this.configuredPlugins.filter((plugin) => this.enabledPlugins.has(plugin.id)).flatMap((plugin) => plugin.publicationReleasePolicies ?? []);
1512
+ return new PublicationAuthorizationService({
1513
+ db: this.db,
1514
+ policies,
1515
+ handlers: {
1516
+ handleContentGet: this.handleContentGet.bind(this),
1517
+ handleContentCompare: this.handleContentCompare.bind(this),
1518
+ handleContentPublish: this.handleContentPublish.bind(this),
1519
+ handleContentSchedule: this.handleContentSchedule.bind(this),
1520
+ handleContentUnschedule: this.handleContentUnschedule.bind(this)
1521
+ }
1522
+ });
1437
1523
  }
1438
1524
  async handleContentPublish(collection, id, options = {}) {
1439
1525
  const result = await handleContentPublish(this.db, collection, id, options);
1440
- if (result.success && result.data) this.runAfterPublishHooks(contentItemToRecord(result.data.item), collection);
1526
+ if (result.success && result.data) {
1527
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1528
+ this.runAfterPublishHooks(contentItemToRecord(result.data.item), collection);
1529
+ }
1441
1530
  return result;
1442
1531
  }
1443
1532
  async handleContentUnpublish(collection, id) {
1444
1533
  const result = await handleContentUnpublish(this.db, collection, id);
1445
- if (result.success && result.data) this.runAfterUnpublishHooks(contentItemToRecord(result.data.item), collection);
1534
+ if (result.success && result.data) {
1535
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1536
+ this.runAfterUnpublishHooks(contentItemToRecord(result.data.item), collection);
1537
+ }
1446
1538
  return result;
1447
1539
  }
1448
1540
  async handleContentSchedule(collection, id, scheduledAt) {
1449
- return handleContentSchedule(this.db, collection, id, scheduledAt);
1541
+ const result = await handleContentSchedule(this.db, collection, id, scheduledAt);
1542
+ if (result.success && result.data) {
1543
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1544
+ this.runAfterScheduleHooks(contentItemToRecord(result.data.item), collection);
1545
+ }
1546
+ return result;
1450
1547
  }
1451
1548
  async handleContentUnschedule(collection, id) {
1452
- return handleContentUnschedule(this.db, collection, id);
1549
+ const result = await handleContentUnschedule(this.db, collection, id);
1550
+ if (result.success && result.data) {
1551
+ await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1552
+ this.runAfterUnscheduleHooks(contentItemToRecord(result.data.item), collection);
1553
+ }
1554
+ return result;
1453
1555
  }
1454
1556
  async handleContentCountScheduled(collection) {
1455
1557
  return handleContentCountScheduled(this.db, collection);
1456
1558
  }
1457
1559
  async handleContentDiscardDraft(collection, id) {
1458
- return handleContentDiscardDraft(this.db, collection, id);
1560
+ const result = await handleContentDiscardDraft(this.db, collection, id);
1561
+ if (result.success && result.data) await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
1562
+ return result;
1459
1563
  }
1460
1564
  async handleContentCompare(collection, id) {
1461
1565
  return handleContentCompare(this.db, collection, id);
@@ -1463,6 +1567,25 @@ var DinewayRuntime = class DinewayRuntime {
1463
1567
  async handleContentTranslations(collection, id) {
1464
1568
  return handleContentTranslations(this.db, collection, id);
1465
1569
  }
1570
+ async refreshContentUsageAfterSuccessfulWrite(collection, contentIds) {
1571
+ for (const contentId of new Set(contentIds)) try {
1572
+ await refreshContentMediaUsageAfterWrite(this.db, collection, contentId);
1573
+ } catch (error) {
1574
+ console.error(`[media-usage] Failed after content write ${collection}/${contentId}:`, error);
1575
+ }
1576
+ }
1577
+ async deleteContentUsageAfterSuccessfulPermanentDelete(collection, contentId) {
1578
+ try {
1579
+ const result = await deleteContentMediaUsage(this.db, collection, contentId);
1580
+ if (!result.success) console.error(`[media-usage] Usage delete for ${collection}/${contentId} finished with ${result.errorCode}`);
1581
+ } catch (error) {
1582
+ console.error(`[media-usage] Failed after permanent content delete ${collection}/${contentId}:`, error);
1583
+ }
1584
+ }
1585
+ async resolveContentId(collection, id, includeTrashed) {
1586
+ const repo = new ContentRepository(this.db);
1587
+ return (includeTrashed ? await repo.findByIdOrSlugIncludingTrashed(collection, id) : await repo.findByIdOrSlug(collection, id))?.id ?? null;
1588
+ }
1466
1589
  async handleMediaList(params) {
1467
1590
  return handleMediaList(this.db, params);
1468
1591
  }
@@ -1526,7 +1649,13 @@ var DinewayRuntime = class DinewayRuntime {
1526
1649
  if (trustedPlugin) {
1527
1650
  const route = trustedPlugin.routes[routeKey];
1528
1651
  if (!route) return null;
1529
- return { public: route.public === true };
1652
+ return {
1653
+ public: route.public === true,
1654
+ body: route.body ?? "json",
1655
+ ...route.body === "raw" ? { maxBodyBytes: route.maxBodyBytes ?? DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES } : {},
1656
+ authorization: route.authorization,
1657
+ apiTokenPolicy: route.apiTokenPolicy
1658
+ };
1530
1659
  }
1531
1660
  const meta = sandboxedRouteMetaCache.get(pluginId);
1532
1661
  if (meta) {
@@ -1535,14 +1664,23 @@ var DinewayRuntime = class DinewayRuntime {
1535
1664
  }
1536
1665
  if (routeKey === "admin") {
1537
1666
  const manifestMeta = marketplaceManifestCache.get(pluginId);
1538
- if (manifestMeta?.admin?.pages?.length || manifestMeta?.admin?.widgets?.length) return { public: false };
1667
+ if (manifestMeta?.admin?.pages?.length || manifestMeta?.admin?.widgets?.length) return {
1668
+ public: false,
1669
+ body: "json"
1670
+ };
1539
1671
  const entry = this.sandboxedPluginEntries.find((e) => e.id === pluginId);
1540
- if (entry?.adminPages?.length || entry?.adminWidgets?.length) return { public: false };
1672
+ if (entry?.adminPages?.length || entry?.adminWidgets?.length) return {
1673
+ public: false,
1674
+ body: "json"
1675
+ };
1541
1676
  }
1542
- if (this.findSandboxedPlugin(pluginId)) return { public: false };
1677
+ if (this.findSandboxedPlugin(pluginId)) return {
1678
+ public: false,
1679
+ body: "json"
1680
+ };
1543
1681
  return null;
1544
1682
  }
1545
- async handlePluginApiRoute(pluginId, _method, path, request) {
1683
+ async handlePluginApiRoute(pluginId, _method, path, request, invocation) {
1546
1684
  if (!this.isPluginEnabled(pluginId)) return {
1547
1685
  success: false,
1548
1686
  error: {
@@ -1555,22 +1693,41 @@ var DinewayRuntime = class DinewayRuntime {
1555
1693
  const routeRegistry = new PluginRouteRegistry({
1556
1694
  ...this.pipelineFactoryOptions,
1557
1695
  db: this.db,
1696
+ storage: this.storage ?? void 0,
1558
1697
  emailPipeline: this.email ?? void 0,
1559
1698
  trustedProxyHeaders: getTrustedProxyHeaders(this.config)
1560
1699
  });
1561
1700
  routeRegistry.register(trustedPlugin);
1562
1701
  const routeKey = path.replace(LEADING_SLASH_PATTERN, "");
1702
+ const trustedRoute = trustedPlugin.routes[routeKey];
1703
+ if ((trustedRoute?.body ?? "json") === "raw") {
1704
+ const bodyResult = await readBoundedPluginRouteBody(request, trustedRoute?.maxBodyBytes ?? DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES);
1705
+ if (!bodyResult.ok) return {
1706
+ success: false,
1707
+ error: {
1708
+ code: "PAYLOAD_TOO_LARGE",
1709
+ message: `Plugin route request body exceeds ${bodyResult.limit} bytes`
1710
+ },
1711
+ status: 413
1712
+ };
1713
+ return routeRegistry.invoke(pluginId, routeKey, {
1714
+ request,
1715
+ rawBody: bodyResult.bytes,
1716
+ actor: invocation?.actor
1717
+ });
1718
+ }
1563
1719
  let body = void 0;
1564
1720
  try {
1565
1721
  body = await request.json();
1566
1722
  } catch {}
1567
1723
  return routeRegistry.invoke(pluginId, routeKey, {
1568
1724
  request,
1569
- body
1725
+ body,
1726
+ actor: invocation?.actor
1570
1727
  });
1571
1728
  }
1572
1729
  const sandboxedPlugin = this.findSandboxedPlugin(pluginId);
1573
- if (sandboxedPlugin) return this.handleSandboxedRoute(sandboxedPlugin, path, request);
1730
+ if (sandboxedPlugin) return this.handleSandboxedRoute(sandboxedPlugin, path, request, invocation?.actor);
1574
1731
  return {
1575
1732
  success: false,
1576
1733
  error: {
@@ -1685,11 +1842,42 @@ var DinewayRuntime = class DinewayRuntime {
1685
1842
  }
1686
1843
  }
1687
1844
  runAfterPublishHooks(content, collection) {
1845
+ this.runDeferredContentHook("content:afterPublish", content, collection);
1846
+ }
1847
+ runAfterUnpublishHooks(content, collection) {
1848
+ this.runDeferredContentHook("content:afterUnpublish", content, collection);
1849
+ }
1850
+ runAfterRestoreHooks(content, collection) {
1851
+ this.runDeferredContentHook("content:afterRestore", content, collection);
1852
+ }
1853
+ runAfterScheduleHooks(content, collection) {
1854
+ this.runDeferredContentHook("content:afterSchedule", content, collection);
1855
+ }
1856
+ runAfterUnscheduleHooks(content, collection) {
1857
+ this.runDeferredContentHook("content:afterUnschedule", content, collection);
1858
+ }
1859
+ runDeferredContentHook(name, content, collection) {
1688
1860
  after(async () => {
1689
- if (this.hooks.hasHooks("content:afterPublish")) try {
1690
- await this.hooks.runContentAfterPublish(content, collection);
1861
+ if (this.hooks.hasHooks(name)) try {
1862
+ switch (name) {
1863
+ case "content:afterPublish":
1864
+ await this.hooks.runContentAfterPublish(content, collection);
1865
+ break;
1866
+ case "content:afterUnpublish":
1867
+ await this.hooks.runContentAfterUnpublish(content, collection);
1868
+ break;
1869
+ case "content:afterRestore":
1870
+ await this.hooks.runContentAfterRestore(content, collection);
1871
+ break;
1872
+ case "content:afterSchedule":
1873
+ await this.hooks.runContentAfterSchedule(content, collection);
1874
+ break;
1875
+ case "content:afterUnschedule":
1876
+ await this.hooks.runContentAfterUnschedule(content, collection);
1877
+ break;
1878
+ }
1691
1879
  } catch (err) {
1692
- console.error("Dineway afterPublish hook error:", err);
1880
+ console.error(`Dineway ${name} hook error:`, err);
1693
1881
  }
1694
1882
  const tasks = [];
1695
1883
  for (const [pluginKey, plugin] of this.sandboxedPlugins) {
@@ -1697,30 +1885,19 @@ var DinewayRuntime = class DinewayRuntime {
1697
1885
  if (!pluginId || !this.isPluginEnabled(pluginId)) continue;
1698
1886
  tasks.push((async () => {
1699
1887
  try {
1700
- await plugin.invokeHook("content:afterPublish", {
1888
+ await plugin.invokeHook(name, {
1701
1889
  content,
1702
1890
  collection
1703
1891
  });
1704
1892
  } catch (err) {
1705
- console.error(`Dineway: Sandboxed plugin ${pluginId} afterPublish error:`, err);
1893
+ console.error(`Dineway: Sandboxed plugin ${pluginId} ${name} error:`, err);
1706
1894
  }
1707
1895
  })());
1708
1896
  }
1709
1897
  await Promise.allSettled(tasks);
1710
1898
  });
1711
1899
  }
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) {
1900
+ async handleSandboxedRoute(plugin, path, request, actor) {
1724
1901
  const routeName = path.replace(LEADING_SLASH_PATTERN, "");
1725
1902
  let body = void 0;
1726
1903
  try {
@@ -1735,7 +1912,8 @@ var DinewayRuntime = class DinewayRuntime {
1735
1912
  url: request.url,
1736
1913
  method: request.method,
1737
1914
  headers,
1738
- meta
1915
+ meta,
1916
+ actor: actor ?? null
1739
1917
  })
1740
1918
  };
1741
1919
  } catch (error) {
@@ -1982,9 +2160,9 @@ function setBaselineSecurityHeaders(response, pathname, serverTimings) {
1982
2160
  const res = new Response(response.body, response);
1983
2161
  const astroCookies = Reflect.get(response, ASTRO_COOKIES_SYMBOL);
1984
2162
  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=()");
2163
+ if (!res.headers.has("X-Content-Type-Options")) res.headers.set("X-Content-Type-Options", "nosniff");
2164
+ if (!res.headers.has("Referrer-Policy")) res.headers.set("Referrer-Policy", "strict-origin-when-cross-origin");
2165
+ if (!res.headers.has("Permissions-Policy")) res.headers.set("Permissions-Policy", "camera=(), microphone=(), geolocation=(), payment=()");
1988
2166
  const shouldSetFrameOptions = !import.meta.env.DEV || pathname.startsWith("/_dineway");
1989
2167
  if (!res.headers.has("Content-Security-Policy") && shouldSetFrameOptions) res.headers.set("X-Frame-Options", "SAMEORIGIN");
1990
2168
  if (serverTimings && serverTimings.length > 0) res.headers.set("Server-Timing", formatServerTimingHeader(serverTimings));
@@ -2059,11 +2237,11 @@ const onRequest = defineMiddleware(async (context, next) => {
2059
2237
  const requestDb = locals.__dinewayRequestDb;
2060
2238
  if (!isDinewayRoute && !isPublicRuntimeRoute && !hasEditCookie && !hasPreviewToken) {
2061
2239
  const hasSessionCookie = cookies.get("astro-session") !== void 0;
2062
- if (!(context.isPrerendered || !hasSessionCookie ? null : await context.session?.get("user")) && !requestDb) {
2063
- if (!isSetupVerified()) {
2240
+ if (!(context.isPrerendered || !hasSessionCookie ? null : await resolveSessionUser(context.session)) && !requestDb) {
2241
+ if (!isSetupVerified() && !context.isPrerendered) {
2064
2242
  const setupStart = startServerTiming(serverTimings);
2065
2243
  try {
2066
- const { getDb } = await import("../loader--GOYux8M.mjs").then((n) => n.i);
2244
+ const { getDb } = await import("../loader-aWkkc1_o.mjs").then((n) => n.i);
2067
2245
  await (await getDb()).selectFrom("_dineway_migrations").selectAll().limit(1).execute();
2068
2246
  markSetupVerified();
2069
2247
  } catch (error) {
@@ -2117,6 +2295,7 @@ const onRequest = defineMiddleware(async (context, next) => {
2117
2295
  locals.dineway = {
2118
2296
  handleContentList: runtime.handleContentList.bind(runtime),
2119
2297
  handleContentGet: runtime.handleContentGet.bind(runtime),
2298
+ handleContentAuthors: runtime.handleContentAuthors.bind(runtime),
2120
2299
  handleContentCreate: runtime.handleContentCreate.bind(runtime),
2121
2300
  handleContentUpdate: runtime.handleContentUpdate.bind(runtime),
2122
2301
  handleContentDelete: runtime.handleContentDelete.bind(runtime),
@@ -2145,6 +2324,7 @@ const onRequest = defineMiddleware(async (context, next) => {
2145
2324
  handlePluginApiRoute: runtime.handlePluginApiRoute.bind(runtime),
2146
2325
  handlePublicPluginApiRoute: createPublicPluginApiRouteHandler(runtime),
2147
2326
  getPluginRouteMeta: runtime.getPluginRouteMeta.bind(runtime),
2327
+ getPluginHttpAccess: runtime.getPluginHttpAccess.bind(runtime),
2148
2328
  getMediaProvider: runtime.getMediaProvider.bind(runtime),
2149
2329
  getMediaProviderList: runtime.getMediaProviderList.bind(runtime),
2150
2330
  collectPageMetadata: runtime.collectPageMetadata.bind(runtime),
@@ -2156,6 +2336,7 @@ const onRequest = defineMiddleware(async (context, next) => {
2156
2336
  hooks: runtime.hooks,
2157
2337
  email: runtime.email,
2158
2338
  configuredPlugins: runtime.configuredPlugins,
2339
+ sandboxedPluginEntries: runtime.sandboxedPluginEntries,
2159
2340
  config,
2160
2341
  getManifest: runtime.getManifest.bind(runtime),
2161
2342
  invalidateManifest: runtime.invalidateManifest.bind(runtime),
@@ -2179,10 +2360,12 @@ const onRequest = defineMiddleware(async (context, next) => {
2179
2360
  return runWithContext(parentContext ? {
2180
2361
  ...parentContext,
2181
2362
  editMode,
2182
- db: requestDb
2363
+ db: requestDb,
2364
+ dbIsIsolated: true
2183
2365
  } : {
2184
2366
  editMode,
2185
- db: requestDb
2367
+ db: requestDb,
2368
+ dbIsIsolated: true
2186
2369
  }, doInit);
2187
2370
  }
2188
2371
  return doInit();