emdash 0.36.0 → 0.38.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 (991) hide show
  1. package/dist/{activation-K0kGBWuJ.mjs → activation-DyNTe_Tl.mjs} +3 -3
  2. package/dist/{activation-K0kGBWuJ.mjs.map → activation-DyNTe_Tl.mjs.map} +1 -1
  3. package/dist/{adapters-CzL3H752.d.mts → adapters-DCEgOBXi.d.mts} +4 -2
  4. package/dist/{adapters-CzL3H752.d.mts.map → adapters-DCEgOBXi.d.mts.map} +1 -1
  5. package/dist/{allowed-origins-maylGaHv.mjs → allowed-origins-GFUVavRj.mjs} +2 -2
  6. package/dist/{allowed-origins-maylGaHv.mjs.map → allowed-origins-GFUVavRj.mjs.map} +1 -1
  7. package/dist/api/route-utils.d.mts +3 -3
  8. package/dist/api/route-utils.mjs +25 -24
  9. package/dist/api/route-utils.mjs.map +1 -1
  10. package/dist/api/schemas/index.d.mts +2 -2
  11. package/dist/api/schemas/index.mjs +5 -5
  12. package/dist/api-BvxJmnFY.mjs +10094 -0
  13. package/dist/api-BvxJmnFY.mjs.map +1 -0
  14. package/dist/{api-tokens-9YrrCoE6.mjs → api-tokens-xpGqMHrC.mjs} +2 -2
  15. package/dist/{api-tokens-9YrrCoE6.mjs.map → api-tokens-xpGqMHrC.mjs.map} +1 -1
  16. package/dist/{apply-B_VMpJ2P.mjs → apply-DLmM3R7f.mjs} +26 -22
  17. package/dist/apply-DLmM3R7f.mjs.map +1 -0
  18. package/dist/artifact-fetch-P2JXVwOq.mjs +972 -0
  19. package/dist/artifact-fetch-P2JXVwOq.mjs.map +1 -0
  20. package/dist/astro/image-endpoint.mjs +2 -2
  21. package/dist/astro/image-endpoint.mjs.map +1 -1
  22. package/dist/astro/index.d.mts +12 -12
  23. package/dist/astro/index.d.mts.map +1 -1
  24. package/dist/astro/index.mjs +138 -39
  25. package/dist/astro/index.mjs.map +1 -1
  26. package/dist/astro/middleware/auth.d.mts +10 -10
  27. package/dist/astro/middleware/auth.mjs +6 -6
  28. package/dist/astro/middleware/media-usage-write-fence.mjs +3 -3
  29. package/dist/astro/middleware/redirect.mjs +7 -5
  30. package/dist/astro/middleware/redirect.mjs.map +1 -1
  31. package/dist/astro/middleware/request-context.mjs +3 -3
  32. package/dist/astro/middleware/setup.mjs +1 -1
  33. package/dist/astro/middleware.d.mts +10 -10
  34. package/dist/astro/middleware.d.mts.map +1 -1
  35. package/dist/astro/middleware.mjs +223 -232
  36. package/dist/astro/middleware.mjs.map +1 -1
  37. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
  38. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
  39. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +3 -3
  40. package/dist/astro/routes/api/admin/api-tokens/index.d.mts.map +1 -1
  41. package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
  42. package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
  43. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  44. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -9
  45. package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -9
  46. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -9
  47. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -17
  48. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -17
  49. package/dist/astro/routes/api/admin/bylines/index.mjs +17 -17
  50. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +13 -13
  51. package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
  52. package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
  53. package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
  54. package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
  55. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
  56. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  57. package/dist/astro/routes/api/admin/media-usage/activation.mjs +13 -13
  58. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +15 -15
  59. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +15 -15
  60. package/dist/astro/routes/api/admin/media-usage/progress.mjs +14 -14
  61. package/dist/astro/routes/api/admin/media-usage/repair.mjs +17 -17
  62. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +15 -15
  63. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +15 -15
  64. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
  65. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
  66. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
  67. package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
  68. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +59 -56
  69. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  70. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +59 -56
  71. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  72. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +57 -54
  73. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  74. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -4
  75. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +57 -54
  76. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  77. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +58 -55
  78. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  79. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +58 -55
  80. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  81. package/dist/astro/routes/api/admin/plugins/index.mjs +57 -54
  82. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  83. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  84. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +57 -54
  85. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +58 -55
  87. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +57 -54
  89. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  90. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +58 -55
  91. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  92. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
  93. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +64 -57
  94. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  95. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +18 -16
  96. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  97. package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
  98. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +65 -58
  99. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  100. package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts +8 -0
  101. package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -0
  102. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +96 -0
  103. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -0
  104. package/dist/astro/routes/api/admin/plugins/updates.mjs +57 -54
  105. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  106. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +57 -54
  107. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  108. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  109. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +57 -54
  110. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  111. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
  112. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  113. package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
  114. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
  115. package/dist/astro/routes/api/admin/users/index.mjs +6 -6
  116. package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -3
  117. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  118. package/dist/astro/routes/api/auth/invite/complete.mjs +11 -11
  119. package/dist/astro/routes/api/auth/invite/index.mjs +8 -8
  120. package/dist/astro/routes/api/auth/invite/register-options.mjs +10 -10
  121. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  122. package/dist/astro/routes/api/auth/magic-link/send.mjs +10 -10
  123. package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
  124. package/dist/astro/routes/api/auth/me.mjs +7 -7
  125. package/dist/astro/routes/api/auth/mode.mjs +2 -2
  126. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
  127. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  128. package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
  129. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  130. package/dist/astro/routes/api/auth/passkey/options.mjs +12 -12
  131. package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -10
  132. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -11
  133. package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -11
  134. package/dist/astro/routes/api/auth/signup/complete.mjs +11 -11
  135. package/dist/astro/routes/api/auth/signup/request.mjs +10 -10
  136. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  137. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -14
  138. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +13 -13
  139. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  140. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -1
  141. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +19 -5
  142. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
  143. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
  144. package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts +10 -0
  145. package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -0
  146. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +66 -0
  147. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -0
  148. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
  149. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -11
  150. package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -1
  151. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +18 -10
  152. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
  153. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +20 -18
  154. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
  155. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +20 -18
  156. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
  157. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
  158. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  159. package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -1
  160. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +15 -8
  161. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
  162. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -15
  163. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
  164. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  165. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -1
  166. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +19 -5
  167. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
  168. package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
  169. package/dist/astro/routes/api/content/_collection_/_id_.mjs +23 -11
  170. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
  171. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  172. package/dist/astro/routes/api/content/_collection_/index.mjs +14 -9
  173. package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
  174. package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
  175. package/dist/astro/routes/api/dashboard.mjs +8 -8
  176. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  177. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  178. package/dist/astro/routes/api/import/probe.mjs +18 -18
  179. package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
  180. package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
  181. package/dist/astro/routes/api/import/wordpress/execute.mjs +15 -14
  182. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  183. package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
  184. package/dist/astro/routes/api/import/wordpress/media.mjs +11 -11
  185. package/dist/astro/routes/api/import/wordpress/prepare.mjs +10 -10
  186. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
  187. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +13 -13
  188. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  189. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +18 -18
  190. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
  191. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +29 -28
  192. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  193. package/dist/astro/routes/api/manifest.mjs +4 -4
  194. package/dist/astro/routes/api/manifest.mjs.map +1 -1
  195. package/dist/astro/routes/api/mcp.mjs +213 -74
  196. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  197. package/dist/astro/routes/api/media/_id_/confirm.mjs +11 -11
  198. package/dist/astro/routes/api/media/_id_/replace.d.mts +8 -0
  199. package/dist/astro/routes/api/media/_id_/replace.d.mts.map +1 -0
  200. package/dist/astro/routes/api/media/_id_/replace.mjs +91 -0
  201. package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -0
  202. package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
  203. package/dist/astro/routes/api/media/_id_/usage.mjs +19 -19
  204. package/dist/astro/routes/api/media/_id_.mjs +18 -18
  205. package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
  206. package/dist/astro/routes/api/media/file/_...key_.mjs +3 -2
  207. package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
  208. package/dist/astro/routes/api/media/folders/_id_.mjs +8 -8
  209. package/dist/astro/routes/api/media/folders/index.mjs +8 -8
  210. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  211. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  212. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  213. package/dist/astro/routes/api/media/upload-url.mjs +16 -14
  214. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  215. package/dist/astro/routes/api/media.d.mts.map +1 -1
  216. package/dist/astro/routes/api/media.mjs +53 -30
  217. package/dist/astro/routes/api/media.mjs.map +1 -1
  218. package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -1
  219. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +20 -13
  220. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
  221. package/dist/astro/routes/api/menus/_name_/items.d.mts.map +1 -1
  222. package/dist/astro/routes/api/menus/_name_/items.mjs +15 -11
  223. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
  224. package/dist/astro/routes/api/menus/_name_/reorder.d.mts.map +1 -1
  225. package/dist/astro/routes/api/menus/_name_/reorder.mjs +15 -11
  226. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
  227. package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -1
  228. package/dist/astro/routes/api/menus/_name_/translations.mjs +16 -12
  229. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
  230. package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -1
  231. package/dist/astro/routes/api/menus/_name_.mjs +21 -14
  232. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
  233. package/dist/astro/routes/api/menus/index.d.mts.map +1 -1
  234. package/dist/astro/routes/api/menus/index.mjs +15 -11
  235. package/dist/astro/routes/api/menus/index.mjs.map +1 -1
  236. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  237. package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
  238. package/dist/astro/routes/api/oauth/device/code.mjs +8 -8
  239. package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
  240. package/dist/astro/routes/api/oauth/register.mjs +2 -2
  241. package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
  242. package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
  243. package/dist/astro/routes/api/oauth/token.mjs +5 -5
  244. package/dist/astro/routes/api/openapi.json.mjs +184 -52
  245. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  246. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
  247. package/dist/astro/routes/api/redirects/404s/index.mjs +12 -11
  248. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  249. package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -11
  250. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  251. package/dist/astro/routes/api/redirects/_id_.mjs +13 -12
  252. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  253. package/dist/astro/routes/api/redirects/index.mjs +13 -12
  254. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  255. package/dist/astro/routes/api/relations/_id_/index.mjs +20 -18
  256. package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
  257. package/dist/astro/routes/api/relations/_id_/translations.mjs +15 -13
  258. package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
  259. package/dist/astro/routes/api/relations/index.mjs +20 -18
  260. package/dist/astro/routes/api/relations/index.mjs.map +1 -1
  261. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  262. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
  263. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +57 -54
  264. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  265. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +57 -54
  266. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  267. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +57 -54
  268. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  269. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +57 -54
  270. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  271. package/dist/astro/routes/api/schema/collections/index.mjs +57 -54
  272. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  273. package/dist/astro/routes/api/schema/collections/reorder.mjs +57 -54
  274. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
  275. package/dist/astro/routes/api/schema/index.mjs +13 -11
  276. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  277. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +57 -54
  278. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  279. package/dist/astro/routes/api/schema/orphans/index.mjs +57 -54
  280. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  281. package/dist/astro/routes/api/search/enable.mjs +12 -11
  282. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  283. package/dist/astro/routes/api/search/index.mjs +11 -10
  284. package/dist/astro/routes/api/search/index.mjs.map +1 -1
  285. package/dist/astro/routes/api/search/rebuild.mjs +12 -11
  286. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  287. package/dist/astro/routes/api/search/stats.mjs +7 -6
  288. package/dist/astro/routes/api/search/stats.mjs.map +1 -1
  289. package/dist/astro/routes/api/search/suggest.mjs +11 -10
  290. package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
  291. package/dist/astro/routes/api/sections/_slug_.mjs +11 -10
  292. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
  293. package/dist/astro/routes/api/sections/index.mjs +11 -10
  294. package/dist/astro/routes/api/sections/index.mjs.map +1 -1
  295. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -6
  296. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
  297. package/dist/astro/routes/api/settings/backups/archives/index.mjs +6 -5
  298. package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
  299. package/dist/astro/routes/api/settings/backups/export.mjs +7 -6
  300. package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
  301. package/dist/astro/routes/api/settings/backups/index.mjs +8 -7
  302. package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
  303. package/dist/astro/routes/api/settings/email.mjs +5 -5
  304. package/dist/astro/routes/api/settings/email.mjs.map +1 -1
  305. package/dist/astro/routes/api/settings.d.mts.map +1 -1
  306. package/dist/astro/routes/api/settings.mjs +21 -17
  307. package/dist/astro/routes/api/settings.mjs.map +1 -1
  308. package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
  309. package/dist/astro/routes/api/setup/admin.mjs +11 -11
  310. package/dist/astro/routes/api/setup/dev-bypass.mjs +35 -33
  311. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  312. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  313. package/dist/astro/routes/api/setup/index.mjs +35 -33
  314. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  315. package/dist/astro/routes/api/setup/status.mjs +3 -3
  316. package/dist/astro/routes/api/snapshot.mjs +8 -7
  317. package/dist/astro/routes/api/snapshot.mjs.map +1 -1
  318. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -1
  319. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +22 -17
  320. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
  321. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -1
  322. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +23 -18
  323. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
  324. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -1
  325. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +27 -19
  326. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
  327. package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
  328. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +22 -17
  329. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
  330. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +16 -15
  331. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
  332. package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -1
  333. package/dist/astro/routes/api/taxonomies/_name_.mjs +28 -20
  334. package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
  335. package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -1
  336. package/dist/astro/routes/api/taxonomies/index.mjs +22 -17
  337. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
  338. package/dist/astro/routes/api/themes/preview.mjs +5 -5
  339. package/dist/astro/routes/api/typegen.mjs +4 -4
  340. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  341. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  342. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  343. package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -1
  344. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +10 -8
  345. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
  346. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
  347. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +18 -14
  348. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
  349. package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts.map +1 -1
  350. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +16 -13
  351. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
  352. package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -1
  353. package/dist/astro/routes/api/widget-areas/_name_.mjs +9 -7
  354. package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
  355. package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -1
  356. package/dist/astro/routes/api/widget-areas/index.mjs +16 -13
  357. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
  358. package/dist/astro/routes/api/widget-components.mjs +2 -2
  359. package/dist/astro/routes/robots.txt.mjs +8 -8
  360. package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -12
  361. package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
  362. package/dist/astro/routes/sitemap.xml.mjs +9 -9
  363. package/dist/astro/types.d.mts +50 -20
  364. package/dist/astro/types.d.mts.map +1 -1
  365. package/dist/auth/providers/github.d.mts +1 -1
  366. package/dist/auth/providers/google.d.mts +1 -1
  367. package/dist/{authorize-ByYs-Uxs.mjs → authorize-C2QHlWSS.mjs} +2 -2
  368. package/dist/{authorize-ByYs-Uxs.mjs.map → authorize-C2QHlWSS.mjs.map} +1 -1
  369. package/dist/{backup-ChyHfIoX.mjs → backup-oS8ft5Cm.mjs} +5 -5
  370. package/dist/{backup-ChyHfIoX.mjs.map → backup-oS8ft5Cm.mjs.map} +1 -1
  371. package/dist/{bundle-DZFhFurR.mjs → bundle-CL0JjIPx.mjs} +4 -4
  372. package/dist/{bundle-DZFhFurR.mjs.map → bundle-CL0JjIPx.mjs.map} +1 -1
  373. package/dist/{byline-Cpnwrje1.mjs → byline-Vdi85CsZ.mjs} +27 -14
  374. package/dist/byline-Vdi85CsZ.mjs.map +1 -0
  375. package/dist/{byline-fields-CAyA_Umd.mjs → byline-fields-DPVRFMz2.mjs} +2 -2
  376. package/dist/{byline-fields-CAyA_Umd.mjs.map → byline-fields-DPVRFMz2.mjs.map} +1 -1
  377. package/dist/{byline-registry-Bpu9-MVs.mjs → byline-registry-BxDGIO0I.mjs} +2 -2
  378. package/dist/{byline-registry-Bpu9-MVs.mjs.map → byline-registry-BxDGIO0I.mjs.map} +1 -1
  379. package/dist/{bylines-BSo9B9RX.mjs → bylines-BX8QhcTk.mjs} +7 -7
  380. package/dist/{bylines-BSo9B9RX.mjs.map → bylines-BX8QhcTk.mjs.map} +1 -1
  381. package/dist/{bylines-CHjvehVX.mjs → bylines-w-E1IEQd.mjs} +3 -3
  382. package/dist/{bylines-CHjvehVX.mjs.map → bylines-w-E1IEQd.mjs.map} +1 -1
  383. package/dist/{cache-5VirJ2Cn.mjs → cache--7HKu5Xm.mjs} +4 -4
  384. package/dist/{cache-5VirJ2Cn.mjs.map → cache--7HKu5Xm.mjs.map} +1 -1
  385. package/dist/{capture-triggers-CNW1q3HK.mjs → capture-triggers-CeAsC76Z.mjs} +2 -2
  386. package/dist/{capture-triggers-CNW1q3HK.mjs.map → capture-triggers-CeAsC76Z.mjs.map} +1 -1
  387. package/dist/{challenge-store-D5pSY2S1.mjs → challenge-store-BIOak-tp.mjs} +5 -3
  388. package/dist/challenge-store-BIOak-tp.mjs.map +1 -0
  389. package/dist/chrome-tags-DzDQBCjX.mjs +24 -0
  390. package/dist/chrome-tags-DzDQBCjX.mjs.map +1 -0
  391. package/dist/{chunks-bNiX6_DR.mjs → chunks-VG_tyqnP.mjs} +2 -2
  392. package/dist/{chunks-bNiX6_DR.mjs.map → chunks-VG_tyqnP.mjs.map} +1 -1
  393. package/dist/cli/index.mjs +68 -40
  394. package/dist/cli/index.mjs.map +1 -1
  395. package/dist/client/cf-access.d.mts +1 -1
  396. package/dist/client/index.d.mts +17 -7
  397. package/dist/client/index.d.mts.map +1 -1
  398. package/dist/client/index.mjs +17 -12
  399. package/dist/client/index.mjs.map +1 -1
  400. package/dist/{collection-deletion-m_oi2c0N.mjs → collection-deletion-BCwaWTDw.mjs} +4 -4
  401. package/dist/{collection-deletion-m_oi2c0N.mjs.map → collection-deletion-BCwaWTDw.mjs.map} +1 -1
  402. package/dist/collection-slugs-cache-7lTmNzeA.mjs +85 -0
  403. package/dist/collection-slugs-cache-7lTmNzeA.mjs.map +1 -0
  404. package/dist/{comment-reaction-CRuItEjt.mjs → comment-reaction-CDyvPQRj.mjs} +2 -2
  405. package/dist/{comment-reaction-CRuItEjt.mjs.map → comment-reaction-CDyvPQRj.mjs.map} +1 -1
  406. package/dist/{comment-DhvLEdhQ.mjs → comment-vxOzWbZN.mjs} +2 -2
  407. package/dist/{comment-DhvLEdhQ.mjs.map → comment-vxOzWbZN.mjs.map} +1 -1
  408. package/dist/{comments-CLj4bi8I.mjs → comments-VzmVLyaC.mjs} +2 -2
  409. package/dist/{comments-CLj4bi8I.mjs.map → comments-VzmVLyaC.mjs.map} +1 -1
  410. package/dist/{components-v4U4DT2y.mjs → components-CL6Wkdk-.mjs} +1 -1
  411. package/dist/{components-v4U4DT2y.mjs.map → components-CL6Wkdk-.mjs.map} +1 -1
  412. package/dist/config--eWjQJE5.mjs +217 -0
  413. package/dist/config--eWjQJE5.mjs.map +1 -0
  414. package/dist/{index-DWbJrsAg.d.mts → config-CGAhyOjP.d.mts} +276 -76
  415. package/dist/config-CGAhyOjP.d.mts.map +1 -0
  416. package/dist/{config-DrfghTPe.d.mts → config-ChFzshGd.d.mts} +1 -1
  417. package/dist/{config-DrfghTPe.d.mts.map → config-ChFzshGd.d.mts.map} +1 -1
  418. package/dist/{content-CP-SeXNa.mjs → content-CNfMWuhY.mjs} +202 -46
  419. package/dist/content-CNfMWuhY.mjs.map +1 -0
  420. package/dist/{content-list-query-BhejKVqb.d.mts → content-list-query-B8d4UQp9.d.mts} +1 -1
  421. package/dist/{content-list-query-BhejKVqb.d.mts.map → content-list-query-B8d4UQp9.d.mts.map} +1 -1
  422. package/dist/{content-refresh-DLOfIhYc.mjs → content-refresh-GTMyi2Xy.mjs} +53 -26
  423. package/dist/content-refresh-GTMyi2Xy.mjs.map +1 -0
  424. package/dist/{content-repair-BCxzy0r4.mjs → content-repair-CIMt5C0U.mjs} +4 -4
  425. package/dist/{content-repair-BCxzy0r4.mjs.map → content-repair-CIMt5C0U.mjs.map} +1 -1
  426. package/dist/{context-BR5hRWiK.mjs → context-C9PB8vGd.mjs} +308 -33
  427. package/dist/context-C9PB8vGd.mjs.map +1 -0
  428. package/dist/{cron-CWfWrWKG.mjs → cron-DHAy9oyq.mjs} +1 -1
  429. package/dist/{cron-CWfWrWKG.mjs.map → cron-DHAy9oyq.mjs.map} +1 -1
  430. package/dist/{dashboard-CkIV2rnQ.mjs → dashboard-BNSvAN8A.mjs} +5 -5
  431. package/dist/{dashboard-CkIV2rnQ.mjs.map → dashboard-BNSvAN8A.mjs.map} +1 -1
  432. package/dist/db/index.d.mts +3 -3
  433. package/dist/db/index.mjs +2 -2
  434. package/dist/db/index.mjs.map +1 -1
  435. package/dist/db/libsql-migrations.d.mts +1 -1
  436. package/dist/db/libsql-migrations.mjs +5 -5
  437. package/dist/db/libsql.d.mts +1 -1
  438. package/dist/db/postgres-migrations.d.mts +1 -1
  439. package/dist/db/postgres-migrations.mjs +5 -5
  440. package/dist/db/postgres.d.mts +1 -1
  441. package/dist/db/postgres.d.mts.map +1 -1
  442. package/dist/db/postgres.mjs +19 -3
  443. package/dist/db/postgres.mjs.map +1 -1
  444. package/dist/db/sqlite-migrations.d.mts +1 -1
  445. package/dist/db/sqlite-migrations.mjs +5 -5
  446. package/dist/db/sqlite.d.mts +1 -1
  447. package/dist/db/sqlite.mjs +1 -1
  448. package/dist/{default-YMEfcQUx.mjs → default-ByZ0JqZo.mjs} +1 -1
  449. package/dist/{default-YMEfcQUx.mjs.map → default-ByZ0JqZo.mjs.map} +1 -1
  450. package/dist/{deferred-tasks-DfqxH5Xf.d.mts → deferred-tasks-Cu4NSJpa.d.mts} +1 -1
  451. package/dist/{deferred-tasks-DfqxH5Xf.d.mts.map → deferred-tasks-Cu4NSJpa.d.mts.map} +1 -1
  452. package/dist/dev-typegen-DHT7lcMU.mjs +29 -0
  453. package/dist/dev-typegen-DHT7lcMU.mjs.map +1 -0
  454. package/dist/{device-flow-CojjSBwb.mjs → device-flow-Cf6bhCCT.mjs} +4 -4
  455. package/dist/{device-flow-CojjSBwb.mjs.map → device-flow-Cf6bhCCT.mjs.map} +1 -1
  456. package/dist/{dialect-helpers-BSbfaO3F.mjs → dialect-helpers-BcQvkHgn.mjs} +83 -2
  457. package/dist/dialect-helpers-BcQvkHgn.mjs.map +1 -0
  458. package/dist/{direct-executor-BWeWiRYB.mjs → direct-executor-yAyUGSqB.mjs} +3 -3
  459. package/dist/{direct-executor-BWeWiRYB.mjs.map → direct-executor-yAyUGSqB.mjs.map} +1 -1
  460. package/dist/{dist-89xCrGqi.mjs → dist-BAsh8dbf.mjs} +1 -1
  461. package/dist/{dist-89xCrGqi.mjs.map → dist-BAsh8dbf.mjs.map} +1 -1
  462. package/dist/{email-console-CEJgR_LB.mjs → email-console-DNup1Fku.mjs} +1 -1
  463. package/dist/{email-console-CEJgR_LB.mjs.map → email-console-DNup1Fku.mjs.map} +1 -1
  464. package/dist/{enrich-BX0IDp4z.mjs → enrich-t2Xvjdqa.mjs} +3 -3
  465. package/dist/{enrich-BX0IDp4z.mjs.map → enrich-t2Xvjdqa.mjs.map} +1 -1
  466. package/dist/entry-lock-BEr8gDkG.mjs +163 -0
  467. package/dist/entry-lock-BEr8gDkG.mjs.map +1 -0
  468. package/dist/{relations-C7B46bcU.d.mts → entry-lock-CGAtrwAR.d.mts} +265 -76
  469. package/dist/entry-lock-CGAtrwAR.d.mts.map +1 -0
  470. package/dist/{redirects-CRIM55KH.mjs → entry-lock-DIYHAaSw.mjs} +112 -34
  471. package/dist/entry-lock-DIYHAaSw.mjs.map +1 -0
  472. package/dist/entry-locks-BEcX7ET0.mjs +167 -0
  473. package/dist/entry-locks-BEcX7ET0.mjs.map +1 -0
  474. package/dist/{error-D9w94fjV.mjs → error-BDcFyoRt.mjs} +2 -2
  475. package/dist/{error-D9w94fjV.mjs.map → error-BDcFyoRt.mjs.map} +1 -1
  476. package/dist/{errors-n2j49uNf.mjs → errors-DvMdNrgf.mjs} +10 -1
  477. package/dist/errors-DvMdNrgf.mjs.map +1 -0
  478. package/dist/{escape-DN4Qmjsl.mjs → escape-B3asJC6W.mjs} +1 -1
  479. package/dist/{escape-DN4Qmjsl.mjs.map → escape-B3asJC6W.mjs.map} +1 -1
  480. package/dist/{field-defs-cache-Bh4q6oar.mjs → field-defs-cache-Cf5FHK0M.mjs} +5 -5
  481. package/dist/{field-defs-cache-Bh4q6oar.mjs.map → field-defs-cache-Cf5FHK0M.mjs.map} +1 -1
  482. package/dist/{fts-manager-BhOdW0bi.mjs → fts-manager-iddym8cd.mjs} +4 -4
  483. package/dist/{fts-manager-BhOdW0bi.mjs.map → fts-manager-iddym8cd.mjs.map} +1 -1
  484. package/dist/{hash-CTcngWvj.mjs → hash-BRweX6jz.mjs} +1 -1
  485. package/dist/{hash-CTcngWvj.mjs.map → hash-BRweX6jz.mjs.map} +1 -1
  486. package/dist/hook-result-BrshYHLx.d.mts +31 -0
  487. package/dist/hook-result-BrshYHLx.d.mts.map +1 -0
  488. package/dist/{hreflang-7pTHsLZJ.d.mts → hreflang-CQpu5bMy.d.mts} +2 -2
  489. package/dist/{hreflang-7pTHsLZJ.d.mts.map → hreflang-CQpu5bMy.d.mts.map} +1 -1
  490. package/dist/{hreflang-Huc6O5wa.mjs → hreflang-DshnweTC.mjs} +9 -8
  491. package/dist/{hreflang-Huc6O5wa.mjs.map → hreflang-DshnweTC.mjs.map} +1 -1
  492. package/dist/{identity-DXmb4aVp.mjs → identity-CjGKDq8J.mjs} +3 -3
  493. package/dist/{identity-DXmb4aVp.mjs.map → identity-CjGKDq8J.mjs.map} +1 -1
  494. package/dist/{import-C4_O3KXU.mjs → import-D96g2otw.mjs} +6 -6
  495. package/dist/{import-C4_O3KXU.mjs.map → import-D96g2otw.mjs.map} +1 -1
  496. package/dist/{index-6bRee8zb.d.mts → index-1ECYpfiF.d.mts} +3 -3
  497. package/dist/{index-6bRee8zb.d.mts.map → index-1ECYpfiF.d.mts.map} +1 -1
  498. package/dist/index.d.mts +22 -21
  499. package/dist/index.mjs +84 -81
  500. package/dist/{init-lock-DJkX6Hto.mjs → init-lock-CFNBe_iH.mjs} +1 -1
  501. package/dist/{init-lock-DJkX6Hto.mjs.map → init-lock-CFNBe_iH.mjs.map} +1 -1
  502. package/dist/{load-Bo7fZAbg.mjs → load-DPtY9cZo.mjs} +2 -2
  503. package/dist/{load-Bo7fZAbg.mjs.map → load-DPtY9cZo.mjs.map} +1 -1
  504. package/dist/{loader-ZsjE4paL.mjs → loader-WJi6GFRn.mjs} +90 -17
  505. package/dist/loader-WJi6GFRn.mjs.map +1 -0
  506. package/dist/{manifest-builder-QXuqvVMP.mjs → manifest-builder-BfNlGQIA.mjs} +2 -2
  507. package/dist/{manifest-builder-QXuqvVMP.mjs.map → manifest-builder-BfNlGQIA.mjs.map} +1 -1
  508. package/dist/{manifest-schema-CUYPfCEH.mjs → manifest-schema-CILooI5J.mjs} +5 -5
  509. package/dist/manifest-schema-CILooI5J.mjs.map +1 -0
  510. package/dist/media/image-endpoint.d.mts +4 -2
  511. package/dist/media/image-endpoint.d.mts.map +1 -1
  512. package/dist/media/image-endpoint.mjs +6 -4
  513. package/dist/media/image-endpoint.mjs.map +1 -1
  514. package/dist/media/index.d.mts +1 -1
  515. package/dist/media/index.mjs +3 -3
  516. package/dist/media/local-runtime.d.mts +12 -12
  517. package/dist/media/local-runtime.mjs +7 -7
  518. package/dist/{media-D6SeAfBl.mjs → media-BBm8Wg3f.mjs} +30 -2
  519. package/dist/media-BBm8Wg3f.mjs.map +1 -0
  520. package/dist/{media-BjwNuLEu.mjs → media-C1EIZKh1.mjs} +35 -5
  521. package/dist/media-C1EIZKh1.mjs.map +1 -0
  522. package/dist/{media-allowlist-D35v7bmL.mjs → media-allowlist-elXJgb_K.mjs} +2 -2
  523. package/dist/{media-allowlist-D35v7bmL.mjs.map → media-allowlist-elXJgb_K.mjs.map} +1 -1
  524. package/dist/{media-folders-D-0CmRZj.mjs → media-folders-DASfX_DH.mjs} +1 -1
  525. package/dist/{media-folders-D-0CmRZj.mjs.map → media-folders-DASfX_DH.mjs.map} +1 -1
  526. package/dist/{media-upload-C7bLXGcI.mjs → media-upload-C7_AQJ5v.mjs} +9 -9
  527. package/dist/{media-upload-C7bLXGcI.mjs.map → media-upload-C7_AQJ5v.mjs.map} +1 -1
  528. package/dist/{media-url-DH7giMx_.mjs → media-url-8dVl1loq.mjs} +19 -2
  529. package/dist/media-url-8dVl1loq.mjs.map +1 -0
  530. package/dist/{media-usage-BTRJvS6V.mjs → media-usage-C1EswMTq.mjs} +10 -10
  531. package/dist/{media-usage-BTRJvS6V.mjs.map → media-usage-C1EswMTq.mjs.map} +1 -1
  532. package/dist/{media-usage-activation-Dx0kPV6b.mjs → media-usage-activation-CrHNltlL.mjs} +3 -3
  533. package/dist/{media-usage-activation-Dx0kPV6b.mjs.map → media-usage-activation-CrHNltlL.mjs.map} +1 -1
  534. package/dist/{media-usage-work-C-fhM30c.mjs → media-usage-work-C5B1zT1c.mjs} +2 -2
  535. package/dist/{media-usage-work-C-fhM30c.mjs.map → media-usage-work-C5B1zT1c.mjs.map} +1 -1
  536. package/dist/{media-usage-work-DWb2XPMI.mjs → media-usage-work-IkQx_Yz6.mjs} +4 -4
  537. package/dist/{media-usage-work-DWb2XPMI.mjs.map → media-usage-work-IkQx_Yz6.mjs.map} +1 -1
  538. package/dist/{media-usage-write-fence-BwoJVRDC.mjs → media-usage-write-fence-B9anjOSg.mjs} +3 -3
  539. package/dist/{media-usage-write-fence-BwoJVRDC.mjs.map → media-usage-write-fence-B9anjOSg.mjs.map} +1 -1
  540. package/dist/{menus-CNg0QlDt.mjs → menus-D8mC4eaN.mjs} +406 -175
  541. package/dist/menus-D8mC4eaN.mjs.map +1 -0
  542. package/dist/{menus-CD7EFLwz.mjs → menus-UdwjHZJC.mjs} +12 -4
  543. package/dist/{menus-CD7EFLwz.mjs.map → menus-UdwjHZJC.mjs.map} +1 -1
  544. package/dist/migrations/index.d.mts +1 -1
  545. package/dist/migrations/index.mjs +4 -4
  546. package/dist/{mime-CUIG6x84.mjs → mime-DYpsOAny.mjs} +1 -1
  547. package/dist/{mime-CUIG6x84.mjs.map → mime-DYpsOAny.mjs.map} +1 -1
  548. package/dist/{mode-DaUM_MB2.mjs → mode-Dm4BHhRH.mjs} +1 -1
  549. package/dist/{mode-DaUM_MB2.mjs.map → mode-Dm4BHhRH.mjs.map} +1 -1
  550. package/dist/{node-sqlite-compat-Udb4Y-rs.mjs → node-sqlite-compat-2sezm-Zd.mjs} +1 -1
  551. package/dist/{node-sqlite-compat-Udb4Y-rs.mjs.map → node-sqlite-compat-2sezm-Zd.mjs.map} +1 -1
  552. package/dist/{normalize-CSxdKBVa.mjs → normalize-4nkKGsuW.mjs} +15 -5
  553. package/dist/normalize-4nkKGsuW.mjs.map +1 -0
  554. package/dist/{oauth-authorization-Dpsb-fMJ.mjs → oauth-authorization-BxE_lURD.mjs} +4 -4
  555. package/dist/{oauth-authorization-Dpsb-fMJ.mjs.map → oauth-authorization-BxE_lURD.mjs.map} +1 -1
  556. package/dist/{oauth-clients-Bxnoe_67.mjs → oauth-clients-DJIdOdq0.mjs} +1 -1
  557. package/dist/{oauth-clients-Bxnoe_67.mjs.map → oauth-clients-DJIdOdq0.mjs.map} +1 -1
  558. package/dist/{oauth-state-store-0C4s0K6w.mjs → oauth-state-store-CsdxP57n.mjs} +1 -1
  559. package/dist/{oauth-state-store-0C4s0K6w.mjs.map → oauth-state-store-CsdxP57n.mjs.map} +1 -1
  560. package/dist/{oauth-user-lookup-wlGYSeqX.mjs → oauth-user-lookup-HzzW-dkF.mjs} +1 -1
  561. package/dist/{oauth-user-lookup-wlGYSeqX.mjs.map → oauth-user-lookup-HzzW-dkF.mjs.map} +1 -1
  562. package/dist/object-cache/memory.d.mts +1 -1
  563. package/dist/{object-cache-71tPfV4A.mjs → object-cache-DVKnyOfy.mjs} +19 -3
  564. package/dist/object-cache-DVKnyOfy.mjs.map +1 -0
  565. package/dist/{options-BHPeIbBd.mjs → options-D1FBiAv1.mjs} +60 -5
  566. package/dist/options-D1FBiAv1.mjs.map +1 -0
  567. package/dist/{options-BhZIeFY1.d.mts → options-D8Y0VHc7.d.mts} +30 -11
  568. package/dist/options-D8Y0VHc7.d.mts.map +1 -0
  569. package/dist/page/index.d.mts +2 -2
  570. package/dist/page/index.d.mts.map +1 -1
  571. package/dist/page/index.mjs +12 -0
  572. package/dist/page/index.mjs.map +1 -1
  573. package/dist/{parse-BRJg1kz8.mjs → parse-WRg5C3NX.mjs} +2 -2
  574. package/dist/{parse-BRJg1kz8.mjs.map → parse-WRg5C3NX.mjs.map} +1 -1
  575. package/dist/{passkey-config-B3P0nHRR.mjs → passkey-config-qIdO-wF6.mjs} +1 -1
  576. package/dist/{passkey-config-B3P0nHRR.mjs.map → passkey-config-qIdO-wF6.mjs.map} +1 -1
  577. package/dist/{patterns-D9iDO3j8.mjs → patterns-DC8CLptu.mjs} +1 -1
  578. package/dist/{patterns-D9iDO3j8.mjs.map → patterns-DC8CLptu.mjs.map} +1 -1
  579. package/dist/{placeholder-BR4ZhVJl.d.mts → placeholder-COrvARyD.d.mts} +1 -1
  580. package/dist/{placeholder-BR4ZhVJl.d.mts.map → placeholder-COrvARyD.d.mts.map} +1 -1
  581. package/dist/plugin-types.d.mts +8 -3
  582. package/dist/plugin-types.d.mts.map +1 -1
  583. package/dist/plugin-utils.d.mts +10 -10
  584. package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
  585. package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
  586. package/dist/{policy-BVRganJQ.mjs → policy-XCfb-IE9.mjs} +2 -2
  587. package/dist/{policy-BVRganJQ.mjs.map → policy-XCfb-IE9.mjs.map} +1 -1
  588. package/dist/{portable-text-C8Tvp4_g.mjs → portable-text-BS3d5n-0.mjs} +1 -1
  589. package/dist/{portable-text-C8Tvp4_g.mjs.map → portable-text-BS3d5n-0.mjs.map} +1 -1
  590. package/dist/{preview-dn2dUyM0.mjs → preview-BxwsGgGp.mjs} +2 -2
  591. package/dist/{preview-dn2dUyM0.mjs.map → preview-BxwsGgGp.mjs.map} +1 -1
  592. package/dist/{protocol-CuBEsqgE.d.mts → protocol-CLn58-nw.d.mts} +2 -2
  593. package/dist/{protocol-CuBEsqgE.d.mts.map → protocol-CLn58-nw.d.mts.map} +1 -1
  594. package/dist/{public-url-DRz_AinV.mjs → public-url-FWWAvnre.mjs} +1 -1
  595. package/dist/{public-url-DRz_AinV.mjs.map → public-url-FWWAvnre.mjs.map} +1 -1
  596. package/dist/{query-D18vTdha.mjs → query-DygOte9M.mjs} +26 -17
  597. package/dist/query-DygOte9M.mjs.map +1 -0
  598. package/dist/{query-tZDEdtCN.mjs → query-gtXT03Wc.mjs} +5 -5
  599. package/dist/{query-tZDEdtCN.mjs.map → query-gtXT03Wc.mjs.map} +1 -1
  600. package/dist/{rate-limit-on7KPo-v.mjs → rate-limit-CQUPm0dh.mjs} +2 -2
  601. package/dist/{rate-limit-on7KPo-v.mjs.map → rate-limit-CQUPm0dh.mjs.map} +1 -1
  602. package/dist/{redirect-DrbEmU9a.mjs → redirect-D1cWafi6.mjs} +1 -1
  603. package/dist/{redirect-DrbEmU9a.mjs.map → redirect-D1cWafi6.mjs.map} +1 -1
  604. package/dist/{redirect-CZkbozu9.mjs → redirect-DId44BS1.mjs} +19 -6
  605. package/dist/redirect-DId44BS1.mjs.map +1 -0
  606. package/dist/{redirects-BahWiu8Z.mjs → redirects-DN-ZE33W.mjs} +5 -5
  607. package/dist/{redirects-BahWiu8Z.mjs.map → redirects-DN-ZE33W.mjs.map} +1 -1
  608. package/dist/{registry-Cx-jEJOS.mjs → registry-DTqaqxed.mjs} +46 -12
  609. package/dist/registry-DTqaqxed.mjs.map +1 -0
  610. package/dist/{relation-A6wLF_DS.mjs → relation-DxgCHOBw.mjs} +2 -2
  611. package/dist/{relation-A6wLF_DS.mjs.map → relation-DxgCHOBw.mjs.map} +1 -1
  612. package/dist/{relations-Cj5hZ6Zg.mjs → relations-KKDSLUwS.mjs} +4 -4
  613. package/dist/{relations-Cj5hZ6Zg.mjs.map → relations-KKDSLUwS.mjs.map} +1 -1
  614. package/dist/{relations-BTPM2saV.mjs → relations-rOmbndUJ.mjs} +8 -8
  615. package/dist/relations-rOmbndUJ.mjs.map +1 -0
  616. package/dist/{request-cache-DH9zdCOD.mjs → request-cache-DAZZmesc.mjs} +1 -1
  617. package/dist/{request-cache-DH9zdCOD.mjs.map → request-cache-DAZZmesc.mjs.map} +1 -1
  618. package/dist/request-context.d.mts +1 -1
  619. package/dist/{request-meta-DRp5ENd_.mjs → request-meta-BgjUQLQ-.mjs} +2 -2
  620. package/dist/{request-meta-DRp5ENd_.mjs.map → request-meta-BgjUQLQ-.mjs.map} +1 -1
  621. package/dist/{resolve-DxUpTMmE.mjs → resolve-Cy0aWSRj.mjs} +37 -4
  622. package/dist/resolve-Cy0aWSRj.mjs.map +1 -0
  623. package/dist/{runner-zgqA_CqP.d.mts → runner-CfwysRM0.d.mts} +3 -2
  624. package/dist/runner-CfwysRM0.d.mts.map +1 -0
  625. package/dist/{runner-77GOZCnH.mjs → runner-nEzvnogG.mjs} +476 -295
  626. package/dist/runner-nEzvnogG.mjs.map +1 -0
  627. package/dist/runtime.d.mts +11 -11
  628. package/dist/runtime.mjs +3 -2
  629. package/dist/runtime.mjs.map +1 -1
  630. package/dist/{schema-BY-oVntF.mjs → schema-CRu38Pr5.mjs} +3 -3
  631. package/dist/{schema-BY-oVntF.mjs.map → schema-CRu38Pr5.mjs.map} +1 -1
  632. package/dist/{schema-Cw9kVK0I.mjs → schema-DifxndJx.mjs} +5 -5
  633. package/dist/{schema-Cw9kVK0I.mjs.map → schema-DifxndJx.mjs.map} +1 -1
  634. package/dist/{scopes-vMR1uIbt.mjs → scopes-D5A1OZbq.mjs} +3 -3
  635. package/dist/{scopes-vMR1uIbt.mjs.map → scopes-D5A1OZbq.mjs.map} +1 -1
  636. package/dist/{search-CfT3KxO5.mjs → search-DEPFSBFq.mjs} +4 -4
  637. package/dist/{search-CfT3KxO5.mjs.map → search-DEPFSBFq.mjs.map} +1 -1
  638. package/dist/{secrets-BH2Qow1-.mjs → secrets-CdfzLdoO.mjs} +3 -3
  639. package/dist/{secrets-BH2Qow1-.mjs.map → secrets-CdfzLdoO.mjs.map} +1 -1
  640. package/dist/{sections-DTfjyf1z.mjs → sections-3X52kmIR.mjs} +2 -2
  641. package/dist/{sections-DTfjyf1z.mjs.map → sections-3X52kmIR.mjs.map} +1 -1
  642. package/dist/seed/index.d.mts +2 -2
  643. package/dist/seed/index.mjs +28 -26
  644. package/dist/seo/index.d.mts +3 -3
  645. package/dist/seo/index.d.mts.map +1 -1
  646. package/dist/seo/index.mjs +20 -21
  647. package/dist/seo/index.mjs.map +1 -1
  648. package/dist/{seo-Cm-dtvgk.mjs → seo-Bw68KxRc.mjs} +3 -3
  649. package/dist/{seo-Cm-dtvgk.mjs.map → seo-Bw68KxRc.mjs.map} +1 -1
  650. package/dist/{seo-BSiTIXzd.mjs → seo-C4AmbsMU.mjs} +3 -2
  651. package/dist/seo-C4AmbsMU.mjs.map +1 -0
  652. package/dist/{service-DYsDHEKe.mjs → service-J_-Vgo7R.mjs} +3 -3
  653. package/dist/{service-DYsDHEKe.mjs.map → service-J_-Vgo7R.mjs.map} +1 -1
  654. package/dist/{session-user-CNAfvsdw.mjs → session-user-CbnMMwk6.mjs} +1 -1
  655. package/dist/{session-user-CNAfvsdw.mjs.map → session-user-CbnMMwk6.mjs.map} +1 -1
  656. package/dist/{settings-DjtkUo__.mjs → settings-AnEFYICn.mjs} +3 -3
  657. package/dist/{settings-DjtkUo__.mjs.map → settings-AnEFYICn.mjs.map} +1 -1
  658. package/dist/{settings-BgN-0DT-.mjs → settings-DcMjREe5.mjs} +21 -8
  659. package/dist/settings-DcMjREe5.mjs.map +1 -0
  660. package/dist/{setup-complete-CcpXaPU7.mjs → setup-complete-BClXXTvr.mjs} +2 -2
  661. package/dist/{setup-complete-CcpXaPU7.mjs.map → setup-complete-BClXXTvr.mjs.map} +1 -1
  662. package/dist/{setup-nonce-Reyw30jg.mjs → setup-nonce-BheRa4RG.mjs} +1 -1
  663. package/dist/{setup-nonce-Reyw30jg.mjs.map → setup-nonce-BheRa4RG.mjs.map} +1 -1
  664. package/dist/{single-flight-cache-BPuGPdcN.mjs → single-flight-cache-jaswDzmQ.mjs} +2 -2
  665. package/dist/{single-flight-cache-BPuGPdcN.mjs.map → single-flight-cache-jaswDzmQ.mjs.map} +1 -1
  666. package/dist/{site-url-Cs_V9n3V.mjs → site-url-Bqf-ea3N.mjs} +3 -3
  667. package/dist/{site-url-Cs_V9n3V.mjs.map → site-url-Bqf-ea3N.mjs.map} +1 -1
  668. package/dist/{snapshot-DSB8P7Lm.mjs → snapshot-C4CtXntb.mjs} +51 -35
  669. package/dist/snapshot-C4CtXntb.mjs.map +1 -0
  670. package/dist/{ssrf-DqebVE34.mjs → ssrf-gl4gFNhw.mjs} +151 -93
  671. package/dist/ssrf-gl4gFNhw.mjs.map +1 -0
  672. package/dist/{state-BJfU9Uzw.mjs → state-1F6IOhdQ.mjs} +1 -1
  673. package/dist/{state-BJfU9Uzw.mjs.map → state-1F6IOhdQ.mjs.map} +1 -1
  674. package/dist/{status-DDu8HIQl.mjs → status-Cenfk_r5.mjs} +1 -1
  675. package/dist/{status-DDu8HIQl.mjs.map → status-Cenfk_r5.mjs.map} +1 -1
  676. package/dist/storage/local.d.mts +2 -1
  677. package/dist/storage/local.d.mts.map +1 -1
  678. package/dist/storage/local.mjs +1 -1
  679. package/dist/storage/local.mjs.map +1 -1
  680. package/dist/storage/s3.d.mts +2 -1
  681. package/dist/storage/s3.d.mts.map +1 -1
  682. package/dist/storage/s3.mjs +3 -2
  683. package/dist/storage/s3.mjs.map +1 -1
  684. package/dist/{target-D0o26Azo.mjs → target-CRzeTs8G.mjs} +1 -1
  685. package/dist/{target-D0o26Azo.mjs.map → target-CRzeTs8G.mjs.map} +1 -1
  686. package/dist/{taxonomies-CPGxo-bn.mjs → taxonomies-BOdxuZpV.mjs} +23 -13
  687. package/dist/taxonomies-BOdxuZpV.mjs.map +1 -0
  688. package/dist/{taxonomies-kmyudNGP.mjs → taxonomies-NcFDq5Gg.mjs} +58 -23
  689. package/dist/taxonomies-NcFDq5Gg.mjs.map +1 -0
  690. package/dist/{taxonomy-8X09dLN5.mjs → taxonomy-DP1vny4K.mjs} +12 -4
  691. package/dist/{taxonomy-8X09dLN5.mjs.map → taxonomy-DP1vny4K.mjs.map} +1 -1
  692. package/dist/{tokens-gTS-IVUp.mjs → tokens-CDk8ox9p.mjs} +1 -1
  693. package/dist/{tokens-gTS-IVUp.mjs.map → tokens-CDk8ox9p.mjs.map} +1 -1
  694. package/dist/{transport-_6R1ub7t.d.mts → transport-BVn4tVb9.d.mts} +1 -1
  695. package/dist/{transport-_6R1ub7t.d.mts.map → transport-BVn4tVb9.d.mts.map} +1 -1
  696. package/dist/{transport-fX59xaJz.mjs → transport-DP0JI-8i.mjs} +1 -1
  697. package/dist/{transport-fX59xaJz.mjs.map → transport-DP0JI-8i.mjs.map} +1 -1
  698. package/dist/{trusted-proxy-fe6nEgR4.mjs → trusted-proxy-BTM6UxqD.mjs} +1 -1
  699. package/dist/{trusted-proxy-fe6nEgR4.mjs.map → trusted-proxy-BTM6UxqD.mjs.map} +1 -1
  700. package/dist/{types-D_DWe7k9.d.mts → types-2n848aVW.d.mts} +3 -2
  701. package/dist/types-2n848aVW.d.mts.map +1 -0
  702. package/dist/types-A2cN6a4a.mjs +3 -0
  703. package/dist/{types-75KIqzL9.mjs → types-BMXnRIrX.mjs} +4 -2
  704. package/dist/types-BMXnRIrX.mjs.map +1 -0
  705. package/dist/{types-Vg6f5i3s.d.mts → types-BouXpOsa.d.mts} +121 -4
  706. package/dist/types-BouXpOsa.d.mts.map +1 -0
  707. package/dist/{types-BXUmsINL.mjs → types-ByG2coLw.mjs} +1 -1
  708. package/dist/{types-BXUmsINL.mjs.map → types-ByG2coLw.mjs.map} +1 -1
  709. package/dist/types-CQPWhPxE.mjs.map +1 -1
  710. package/dist/{types-Blb-MRC3.d.mts → types-DEfNJ__A.d.mts} +1 -1
  711. package/dist/{types-Blb-MRC3.d.mts.map → types-DEfNJ__A.d.mts.map} +1 -1
  712. package/dist/{types-Br-ERaxh.d.mts → types-DKcKSbtB.d.mts} +23 -7
  713. package/dist/types-DKcKSbtB.d.mts.map +1 -0
  714. package/dist/{types-BzBd3PeX.d.mts → types-DRYs7uTL.d.mts} +1 -1
  715. package/dist/{types-BzBd3PeX.d.mts.map → types-DRYs7uTL.d.mts.map} +1 -1
  716. package/dist/{types-CLqvnd05.d.mts → types-DaEg7KX2.d.mts} +1 -1
  717. package/dist/{types-CLqvnd05.d.mts.map → types-DaEg7KX2.d.mts.map} +1 -1
  718. package/dist/{types-DJQxln7q.d.mts → types-LU8utpP_.d.mts} +14 -10
  719. package/dist/types-LU8utpP_.d.mts.map +1 -0
  720. package/dist/{types-D5VVLr7J.d.mts → types-VpYfPUxN.d.mts} +1 -1
  721. package/dist/{types-D5VVLr7J.d.mts.map → types-VpYfPUxN.d.mts.map} +1 -1
  722. package/dist/{types-DM3vioBY.mjs → types-c9GP7Dj5.mjs} +1 -1
  723. package/dist/{types-DM3vioBY.mjs.map → types-c9GP7Dj5.mjs.map} +1 -1
  724. package/dist/{types-DHxzBjbD.d.mts → types-tJWDK__M.d.mts} +14 -1
  725. package/dist/types-tJWDK__M.d.mts.map +1 -0
  726. package/dist/{upload-attempts-CNyGSepg.mjs → upload-attempts-C6S2y-lp.mjs} +1 -1
  727. package/dist/{upload-attempts-CNyGSepg.mjs.map → upload-attempts-C6S2y-lp.mjs.map} +1 -1
  728. package/dist/{url-pattern-K-KdXcSe.mjs → url-pattern-UYtxVTuj.mjs} +1 -1
  729. package/dist/{url-pattern-K-KdXcSe.mjs.map → url-pattern-UYtxVTuj.mjs.map} +1 -1
  730. package/dist/{user-CtYY0tp2.mjs → user-DIsIXogT.mjs} +2 -2
  731. package/dist/{user-CtYY0tp2.mjs.map → user-DIsIXogT.mjs.map} +1 -1
  732. package/dist/{utils-HztC73hq.mjs → utils-BicP5Qbg.mjs} +2 -2
  733. package/dist/{utils-HztC73hq.mjs.map → utils-BicP5Qbg.mjs.map} +1 -1
  734. package/dist/{validate-Dd-IUjnZ.mjs → validate-D8VPn4Hv.mjs} +8 -3
  735. package/dist/validate-D8VPn4Hv.mjs.map +1 -0
  736. package/dist/{validate-DlqdOZXB.d.mts → validate-Df6Dvwbw.d.mts} +12 -7
  737. package/dist/validate-Df6Dvwbw.d.mts.map +1 -0
  738. package/dist/{validation-D83n7Npi.mjs → validation-CzMJn9Ku.mjs} +13 -11
  739. package/dist/{validation-D83n7Npi.mjs.map → validation-CzMJn9Ku.mjs.map} +1 -1
  740. package/dist/version-CK67_SXX.mjs +7 -0
  741. package/dist/{version-ri-sCyAp.mjs.map → version-CK67_SXX.mjs.map} +1 -1
  742. package/dist/{widgets-CpmZd9Q-.mjs → widgets-RFVAxQl3.mjs} +18 -5
  743. package/dist/widgets-RFVAxQl3.mjs.map +1 -0
  744. package/dist/{wxr-taxonomies-BFd0y72_.d.mts → wxr-taxonomies-BX4yQL9s.d.mts} +1 -1
  745. package/dist/{wxr-taxonomies-BFd0y72_.d.mts.map → wxr-taxonomies-BX4yQL9s.d.mts.map} +1 -1
  746. package/dist/{wxr-taxonomies-Df4vxWcU.mjs → wxr-taxonomies-Csdp7yde.mjs} +4 -4
  747. package/dist/{wxr-taxonomies-Df4vxWcU.mjs.map → wxr-taxonomies-Csdp7yde.mjs.map} +1 -1
  748. package/dist/{zod-generator-DylzusHh.mjs → zod-generator-CNRGdnBY.mjs} +11 -7
  749. package/dist/zod-generator-CNRGdnBY.mjs.map +1 -0
  750. package/package.json +16 -11
  751. package/src/api/errors.ts +9 -0
  752. package/src/api/handlers/content.ts +115 -90
  753. package/src/api/handlers/entry-lock.ts +206 -0
  754. package/src/api/handlers/index.ts +1 -0
  755. package/src/api/handlers/manifest.ts +162 -12
  756. package/src/api/handlers/marketplace.ts +28 -20
  757. package/src/api/handlers/media.ts +30 -0
  758. package/src/api/handlers/menus.ts +9 -0
  759. package/src/api/handlers/registry.ts +406 -297
  760. package/src/api/handlers/revision.ts +2 -1
  761. package/src/api/handlers/seo.ts +10 -1
  762. package/src/api/handlers/snapshot.ts +84 -72
  763. package/src/api/handlers/taxonomies.ts +25 -9
  764. package/src/api/openapi/document.ts +196 -11
  765. package/src/api/parse.ts +1 -1
  766. package/src/api/schemas/auth.ts +4 -4
  767. package/src/api/schemas/bylines.ts +3 -3
  768. package/src/api/schemas/comments.ts +1 -1
  769. package/src/api/schemas/common.ts +3 -2
  770. package/src/api/schemas/content.ts +86 -22
  771. package/src/api/schemas/entry-lock.ts +48 -0
  772. package/src/api/schemas/index.ts +1 -0
  773. package/src/api/schemas/media.ts +52 -0
  774. package/src/api/schemas/redirects.ts +6 -1
  775. package/src/api/schemas/schema.ts +14 -1
  776. package/src/api/schemas/setup.ts +1 -1
  777. package/src/api/schemas/taxonomies.ts +2 -2
  778. package/src/api/schemas/users.ts +1 -1
  779. package/src/api/types.ts +25 -10
  780. package/src/astro/dev-typegen.ts +35 -0
  781. package/src/astro/image-endpoint.ts +2 -2
  782. package/src/astro/integration/dev-typegen.ts +91 -0
  783. package/src/astro/integration/index.ts +18 -50
  784. package/src/astro/integration/routes.ts +10 -0
  785. package/src/astro/integration/runtime.ts +13 -5
  786. package/src/astro/integration/vite-config.ts +51 -2
  787. package/src/astro/middleware.ts +21 -0
  788. package/src/astro/routes/api/admin/api-tokens/index.ts +4 -1
  789. package/src/astro/routes/api/admin/oauth-clients/[id].ts +1 -1
  790. package/src/astro/routes/api/admin/oauth-clients/index.ts +1 -1
  791. package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
  792. package/src/astro/routes/api/admin/plugins/registry/artifact.ts +3 -7
  793. package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
  794. package/src/astro/routes/api/admin/plugins/registry/verify.ts +60 -0
  795. package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +18 -2
  796. package/src/astro/routes/api/content/[collection]/[id]/lock.ts +133 -0
  797. package/src/astro/routes/api/content/[collection]/[id]/publish.ts +12 -1
  798. package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +20 -0
  799. package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +16 -2
  800. package/src/astro/routes/api/content/[collection]/[id].ts +27 -2
  801. package/src/astro/routes/api/content/[collection]/index.ts +3 -0
  802. package/src/astro/routes/api/manifest.ts +1 -1
  803. package/src/astro/routes/api/media/[id]/replace.ts +114 -0
  804. package/src/astro/routes/api/media/file/[...key].ts +4 -1
  805. package/src/astro/routes/api/media/upload-url.ts +8 -4
  806. package/src/astro/routes/api/media.ts +54 -8
  807. package/src/astro/routes/api/menus/[name]/items/[id].ts +7 -2
  808. package/src/astro/routes/api/menus/[name]/items.ts +4 -1
  809. package/src/astro/routes/api/menus/[name]/reorder.ts +4 -1
  810. package/src/astro/routes/api/menus/[name]/translations.ts +4 -1
  811. package/src/astro/routes/api/menus/[name].ts +7 -2
  812. package/src/astro/routes/api/menus/index.ts +4 -1
  813. package/src/astro/routes/api/settings/email.ts +1 -1
  814. package/src/astro/routes/api/settings.ts +4 -1
  815. package/src/astro/routes/api/taxonomies/[name]/reorder.ts +4 -1
  816. package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +4 -1
  817. package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +7 -2
  818. package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +4 -1
  819. package/src/astro/routes/api/taxonomies/[name].ts +7 -2
  820. package/src/astro/routes/api/taxonomies/index.ts +4 -1
  821. package/src/astro/routes/api/widget-areas/[name]/reorder.ts +3 -1
  822. package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +5 -2
  823. package/src/astro/routes/api/widget-areas/[name]/widgets.ts +3 -1
  824. package/src/astro/routes/api/widget-areas/[name].ts +3 -1
  825. package/src/astro/routes/api/widget-areas/index.ts +3 -1
  826. package/src/astro/routes/sitemap-[collection].xml.ts +4 -0
  827. package/src/astro/types.ts +36 -8
  828. package/src/auth/challenge-store.ts +3 -1
  829. package/src/aws-sdk.d.ts +1 -0
  830. package/src/cache/chrome-tags.ts +24 -0
  831. package/src/cli/commands/content.ts +31 -5
  832. package/src/cli/commands/export-seed.ts +2 -0
  833. package/src/client/index.ts +34 -7
  834. package/src/components/EmDashBodyEnd.astro +4 -1
  835. package/src/components/EmDashBodyStart.astro +4 -1
  836. package/src/components/EmDashHead.astro +35 -16
  837. package/src/components/EmDashImage.astro +2 -1
  838. package/src/components/EmDashMedia.astro +2 -1
  839. package/src/components/Gallery.astro +18 -4
  840. package/src/components/InlineEditor.astro +3 -1
  841. package/src/components/InlinePortableTextEditor.tsx +112 -12
  842. package/src/components/PortableText.astro +4 -0
  843. package/src/components/Table.astro +147 -62
  844. package/src/components/widgets/Archives.astro +2 -37
  845. package/src/config/errors.ts +13 -0
  846. package/src/content/converters/index.ts +2 -0
  847. package/src/content/converters/mark-safety.ts +1 -0
  848. package/src/content/converters/portable-text-identity.ts +139 -0
  849. package/src/content/converters/portable-text-to-prosemirror.ts +226 -69
  850. package/src/content/converters/prosemirror-to-portable-text.ts +128 -28
  851. package/src/content/converters/types.ts +11 -0
  852. package/src/database/dialect-helpers.ts +125 -0
  853. package/src/database/migrations/017_authorization_codes.ts +14 -4
  854. package/src/database/migrations/074_content_deleted_scheduled_index.ts +55 -0
  855. package/src/database/migrations/075_entry_edit_locks.ts +44 -0
  856. package/src/database/migrations/076_collection_nav_group.ts +22 -0
  857. package/src/database/migrations/077_plugin_storage_revisions.ts +89 -0
  858. package/src/database/migrations/runner.ts +9 -1
  859. package/src/database/repositories/byline.ts +32 -16
  860. package/src/database/repositories/content.ts +284 -48
  861. package/src/database/repositories/entry-locks.ts +257 -0
  862. package/src/database/repositories/media-usage.ts +66 -37
  863. package/src/database/repositories/media.ts +60 -1
  864. package/src/database/repositories/options.ts +69 -5
  865. package/src/database/repositories/plugin-storage.ts +233 -9
  866. package/src/database/repositories/redirect.ts +17 -6
  867. package/src/database/repositories/taxonomy.ts +8 -0
  868. package/src/database/repositories/types.ts +11 -7
  869. package/src/database/types.ts +15 -1
  870. package/src/db/adapters.ts +8 -1
  871. package/src/db/postgres.ts +23 -0
  872. package/src/emdash-runtime.ts +196 -199
  873. package/src/fields/boolean.ts +1 -1
  874. package/src/fields/datetime.ts +1 -1
  875. package/src/fields/file.ts +1 -1
  876. package/src/fields/integer.ts +1 -1
  877. package/src/fields/json.ts +1 -1
  878. package/src/fields/multiselect.ts +1 -1
  879. package/src/fields/number.ts +1 -1
  880. package/src/fields/portable-text.ts +1 -1
  881. package/src/fields/richtext.ts +1 -1
  882. package/src/fields/select.ts +1 -1
  883. package/src/fields/slug.ts +1 -1
  884. package/src/fields/text.ts +1 -1
  885. package/src/fields/textarea.ts +1 -1
  886. package/src/fields/types.ts +2 -2
  887. package/src/i18n/resolve.ts +44 -4
  888. package/src/index.ts +39 -3
  889. package/src/loader.ts +96 -12
  890. package/src/mcp/server.ts +251 -29
  891. package/src/media/image-endpoint.ts +5 -2
  892. package/src/media/normalize.ts +15 -4
  893. package/src/media/responsive.ts +23 -0
  894. package/src/media/usage/cleanup.ts +9 -8
  895. package/src/media/usage/content-refresh.ts +2 -1
  896. package/src/menus/index.ts +33 -21
  897. package/src/object-cache/index.ts +44 -2
  898. package/src/page/seo-contributions.ts +78 -1
  899. package/src/page/seo-panel.ts +47 -0
  900. package/src/plugin-types.ts +27 -1
  901. package/src/plugins/conditional-storage.ts +30 -0
  902. package/src/plugins/context.ts +49 -17
  903. package/src/plugins/hooks.ts +10 -1
  904. package/src/plugins/index.ts +15 -0
  905. package/src/plugins/manager.ts +6 -2
  906. package/src/plugins/manifest-schema.ts +1 -1
  907. package/src/plugins/routes.ts +3 -1
  908. package/src/plugins/sandbox/hook-result.ts +52 -0
  909. package/src/plugins/sandbox/index.ts +10 -0
  910. package/src/plugins/sandbox/types.ts +16 -2
  911. package/src/plugins/storage-query.ts +45 -0
  912. package/src/plugins/storage-update.ts +96 -0
  913. package/src/plugins/types.ts +120 -0
  914. package/src/query.ts +29 -3
  915. package/src/registry/artifact-checksum.ts +15 -0
  916. package/src/registry/artifact-verification.ts +85 -0
  917. package/src/registry/authoritative-records.ts +180 -0
  918. package/src/registry/config.ts +130 -27
  919. package/src/registry/record-labels.ts +28 -0
  920. package/src/registry/types.ts +5 -6
  921. package/src/schema/collection-slugs-cache.ts +157 -0
  922. package/src/schema/registry.ts +45 -3
  923. package/src/schema/types.ts +25 -6
  924. package/src/schema/zod-generator.ts +16 -13
  925. package/src/security/ssrf.ts +172 -143
  926. package/src/seed/apply.ts +4 -0
  927. package/src/seed/types.ts +7 -2
  928. package/src/seed/validate.ts +18 -1
  929. package/src/seo/hreflang.ts +1 -0
  930. package/src/seo/index.ts +5 -10
  931. package/src/seo/media-url.ts +26 -0
  932. package/src/settings/index.ts +16 -0
  933. package/src/storage/local.ts +1 -0
  934. package/src/storage/s3.ts +2 -0
  935. package/src/storage/types.ts +2 -0
  936. package/src/taxonomies/index.ts +40 -20
  937. package/src/taxonomies/term-counts.ts +22 -5
  938. package/src/widgets/archives.ts +67 -0
  939. package/src/widgets/index.ts +16 -0
  940. package/dist/api-B0w3uBiG.mjs +0 -2269
  941. package/dist/api-B0w3uBiG.mjs.map +0 -1
  942. package/dist/apply-B_VMpJ2P.mjs.map +0 -1
  943. package/dist/byline-Cpnwrje1.mjs.map +0 -1
  944. package/dist/challenge-store-D5pSY2S1.mjs.map +0 -1
  945. package/dist/content-CP-SeXNa.mjs.map +0 -1
  946. package/dist/content-refresh-DLOfIhYc.mjs.map +0 -1
  947. package/dist/context-BR5hRWiK.mjs.map +0 -1
  948. package/dist/dialect-helpers-BSbfaO3F.mjs.map +0 -1
  949. package/dist/errors-n2j49uNf.mjs.map +0 -1
  950. package/dist/index-DWbJrsAg.d.mts.map +0 -1
  951. package/dist/loader-ZsjE4paL.mjs.map +0 -1
  952. package/dist/manifest-schema-CUYPfCEH.mjs.map +0 -1
  953. package/dist/media-BjwNuLEu.mjs.map +0 -1
  954. package/dist/media-D6SeAfBl.mjs.map +0 -1
  955. package/dist/media-url-DH7giMx_.mjs.map +0 -1
  956. package/dist/menus-CNg0QlDt.mjs.map +0 -1
  957. package/dist/normalize-CSxdKBVa.mjs.map +0 -1
  958. package/dist/object-cache-71tPfV4A.mjs.map +0 -1
  959. package/dist/options-BHPeIbBd.mjs.map +0 -1
  960. package/dist/options-BhZIeFY1.d.mts.map +0 -1
  961. package/dist/query-D18vTdha.mjs.map +0 -1
  962. package/dist/redirect-CZkbozu9.mjs.map +0 -1
  963. package/dist/redirects-CRIM55KH.mjs.map +0 -1
  964. package/dist/registry-BiO5WwPq.mjs +0 -2716
  965. package/dist/registry-BiO5WwPq.mjs.map +0 -1
  966. package/dist/registry-Cx-jEJOS.mjs.map +0 -1
  967. package/dist/relations-BTPM2saV.mjs.map +0 -1
  968. package/dist/relations-C7B46bcU.d.mts.map +0 -1
  969. package/dist/resolve-DxUpTMmE.mjs.map +0 -1
  970. package/dist/runner-77GOZCnH.mjs.map +0 -1
  971. package/dist/runner-zgqA_CqP.d.mts.map +0 -1
  972. package/dist/seo-BSiTIXzd.mjs.map +0 -1
  973. package/dist/settings-BgN-0DT-.mjs.map +0 -1
  974. package/dist/snapshot-DSB8P7Lm.mjs.map +0 -1
  975. package/dist/ssrf-DqebVE34.mjs.map +0 -1
  976. package/dist/taxonomies-CPGxo-bn.mjs.map +0 -1
  977. package/dist/taxonomies-kmyudNGP.mjs.map +0 -1
  978. package/dist/types-75KIqzL9.mjs.map +0 -1
  979. package/dist/types-Br-ERaxh.d.mts.map +0 -1
  980. package/dist/types-D6OcIp2P.mjs +0 -3
  981. package/dist/types-DHxzBjbD.d.mts.map +0 -1
  982. package/dist/types-DJQxln7q.d.mts.map +0 -1
  983. package/dist/types-D_DWe7k9.d.mts.map +0 -1
  984. package/dist/types-Vg6f5i3s.d.mts.map +0 -1
  985. package/dist/validate-Dd-IUjnZ.mjs.map +0 -1
  986. package/dist/validate-DlqdOZXB.d.mts.map +0 -1
  987. package/dist/version-ri-sCyAp.mjs +0 -7
  988. package/dist/widgets-CpmZd9Q-.mjs.map +0 -1
  989. package/dist/zod-generator-DylzusHh.mjs.map +0 -1
  990. /package/dist/{api-tokens-B5NHLNUN.mjs → api-tokens-B_lfpmH3.mjs} +0 -0
  991. /package/dist/{ssrf-BPKzkm6O.mjs → ssrf-TQhaljuI.mjs} +0 -0
@@ -1,46 +1,19 @@
1
1
  /**
2
- * Registry plugin install handler.
3
- *
4
- * Installs a plugin published to the experimental decentralized plugin
5
- * registry described in RFC 0001. The install flow:
6
- *
7
- * 1. Resolve `(handle, slug)` to a publisher DID via the configured
8
- * aggregator's `resolvePackage` XRPC.
9
- * 2. Look up the requested release (or the policy-filtered latest one)
10
- * via `getLatestRelease` / `listReleases`.
11
- * 3. Require the aggregator's approved listing projection, then apply the
12
- * independent release-age and environment policies.
13
- * 4. Fetch the bundle artifact through an advertised record-scoped cache,
14
- * the publisher PDS, or the publisher-declared URL.
15
- * 5. Verify the artifact's multibase checksum against the signed
16
- * release record's `artifacts.package.checksum`.
17
- * 6. Extract `manifest.json` + `backend.js` + optional `admin.js` from
18
- * the gzipped tar bundle.
19
- * 7. Store the extracted files in site-local R2 under the
20
- * `registry/<plugin-id>/<version>/` prefix.
21
- * 8. Write a `plugin_states` row with `source = "registry"` and the
22
- * `(publisher_did, slug)` pair so updates can be resolved later.
23
- * 9. Sync the runtime so the plugin becomes active immediately.
24
- *
25
- * Known gaps (tracked separately):
26
- *
27
- * - The aggregator-supplied records are not yet cryptographically
28
- * verified against the publisher's MST signature. The signed bytes
29
- * and CIDs are passed through verbatim per the lexicon, but full
30
- * PDS-direct verification with proof traversal is follow-up work.
31
- * The artifact checksum is verified end-to-end against the value
32
- * in the (aggregator-relayed) release record, which is the actual
33
- * trust boundary for the bytes that end up in the sandbox.
34
- * - Listing approval controls whether metadata is eligible for discovery.
35
- * It is never treated as approval of plugin code: checksum, bundle,
36
- * manifest, access, consent, sandbox, and environment gates remain
37
- * independent below.
2
+ * Registry installs use aggregator results only for discovery and moderation
3
+ * metadata. The handler reads profile and release records from the publisher's
4
+ * PDS, verifies their repository proofs, then validates the bundle checksum,
5
+ * manifest, policy, and consent before storing or activating executable code.
6
+ * Applicable labels can block installation but cannot supply any verified
7
+ * record, checksum, permission, or executable byte.
38
8
  */
39
9
 
40
10
  import { ClientResponseError, ClientValidationError } from "@atcute/client";
41
11
  import type { Did } from "@atcute/lexicons";
12
+ import { canonicalizeDeclaredAccess } from "@emdash-cms/plugin-types";
13
+ import type { CanonicalDeclaredAccess } from "@emdash-cms/plugin-types";
42
14
  import { checkEnvCompatibility, findSkippedEnvConstraints } from "@emdash-cms/registry-client/env";
43
15
  import type { HostEnv } from "@emdash-cms/registry-client/env";
16
+ import { isProvenFirstRelease } from "@emdash-cms/registry-client/listing-policy";
44
17
  import { evaluateRegistryReleaseWithdrawal } from "@emdash-cms/registry-client/withdrawal";
45
18
  import { NSID } from "@emdash-cms/registry-lexicons";
46
19
  import {
@@ -50,8 +23,7 @@ import {
50
23
  import type { Kysely } from "kysely";
51
24
 
52
25
  import type { Database } from "../../database/types.js";
53
- import { extractBundle } from "../../plugins/marketplace.js";
54
- import type { PluginBundle } from "../../plugins/marketplace.js";
26
+ import { withUnavailableReason } from "../../plugins/sandbox/types.js";
55
27
  import type { SandboxRunner } from "../../plugins/sandbox/types.js";
56
28
  import { PluginStateRepository } from "../../plugins/state.js";
57
29
  import {
@@ -61,6 +33,19 @@ import {
61
33
  import { declaredAccessToCapabilities } from "../../plugins/types.js";
62
34
  import type { DeclaredAccess } from "../../plugins/types.js";
63
35
  import { fetchRegistryArtifactUrl } from "../../registry/artifact-fetch.js";
36
+ import {
37
+ validateRegistryArtifact,
38
+ type RegistryArtifactVerificationCode,
39
+ } from "../../registry/artifact-verification.js";
40
+ import {
41
+ readAuthoritativePackageRelease,
42
+ verifyAuthoritativePackageRelease,
43
+ type AuthoritativeRecordErrorCode,
44
+ type AuthoritativeRecordReader,
45
+ type AuthoritativeRecordReadOptions,
46
+ type VerifiedAuthoritativeReleaseReport,
47
+ type VerifiedAuthoritativeRecords,
48
+ } from "../../registry/authoritative-records.js";
64
49
  import {
65
50
  canonicalCapabilitiesForDriftCheck,
66
51
  coerceRegistryConfig,
@@ -69,6 +54,7 @@ import {
69
54
  validateAggregatorUrl,
70
55
  } from "../../registry/config.js";
71
56
  import { makeRegistryPluginId } from "../../registry/plugin-id.js";
57
+ import { hasCurrentRecordLabel } from "../../registry/record-labels.js";
72
58
  import type { RegistryConfigInput } from "../../registry/types.js";
73
59
  import { resolveAndValidateExternalUrlTarget } from "../../security/ssrf.js";
74
60
  import { EmDashStorageError } from "../../storage/types.js";
@@ -84,8 +70,6 @@ import {
84
70
 
85
71
  export { assertSafeArtifactUrl } from "../../registry/artifact-fetch.js";
86
72
 
87
- const RELEASE_EXTENSION_NSID = "com.emdashcms.experimental.package.releaseExtension";
88
-
89
73
  /**
90
74
  * Whether two `declaredAccess` blocks grant exactly the same enforced access --
91
75
  * the same capabilities AND the same host allow-list. Both are lowered through
@@ -104,6 +88,10 @@ export function enforcedAccessEqual(a: DeclaredAccess, b: DeclaredAccess): boole
104
88
  );
105
89
  }
106
90
 
91
+ function verifiedAccessEqual(a: CanonicalDeclaredAccess, b: DeclaredAccess): boolean {
92
+ return JSON.stringify(a) === JSON.stringify(canonicalizeDeclaredAccess(b));
93
+ }
94
+
107
95
  // ── Types ──────────────────────────────────────────────────────────
108
96
 
109
97
  export interface RegistryInstallInput {
@@ -134,6 +122,8 @@ export interface RegistryInstallInput {
134
122
  */
135
123
  acknowledgedDeclaredAccess?: unknown;
136
124
  acknowledgedMcpTools?: unknown;
125
+ acknowledgedProfileCid?: string;
126
+ acknowledgedReleaseCid?: string;
137
127
  }
138
128
 
139
129
  export interface RegistryInstallResult {
@@ -147,84 +137,120 @@ export interface RegistryInstallResult {
147
137
  version: string;
148
138
  /** Capabilities surfaced from the bundle's manifest. */
149
139
  capabilities: string[];
140
+ declaredAccess: DeclaredAccess;
141
+ mcpTools: RegistryMcpConsentTool[];
142
+ verification: RegistryRecordVerificationSummary;
150
143
  }
151
144
 
152
- // ── Helpers ────────────────────────────────────────────────────────
153
-
154
- /** Matches a bare 64-character lowercase/uppercase hex SHA-256 digest. */
155
- const SHA256_HEX_PATTERN = /^[a-f0-9]{64}$/i;
145
+ export interface RegistryMcpConsentTool {
146
+ name: string;
147
+ description: string;
148
+ route: string;
149
+ permission: string;
150
+ destructive: boolean;
151
+ }
156
152
 
157
- /** Compute the SHA-256 of `bytes` as a lowercase hex string. */
158
- async function sha256Hex(bytes: Uint8Array): Promise<string> {
159
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Uint8Array is a valid BufferSource at runtime
160
- const buf = await crypto.subtle.digest("SHA-256", bytes as unknown as BufferSource);
161
- const arr = new Uint8Array(buf);
162
- return Array.from(arr, (b) => b.toString(16).padStart(2, "0")).join("");
153
+ export interface RegistryRecordVerificationSummary {
154
+ profileCid: string;
155
+ releaseCid: string;
156
+ provenance: "verified" | "absent-optional";
157
+ policy: {
158
+ requireProvenance: boolean;
159
+ confirmation: "escalation-only" | "always";
160
+ approvers: string[];
161
+ };
163
162
  }
164
163
 
165
- /** multihash code for sha2-256 (single-byte varint). */
166
- const MULTIHASH_SHA256_CODE = 0x12;
167
- /** sha2-256 digest length in bytes (single-byte varint). */
168
- const MULTIHASH_SHA256_LENGTH = 0x20;
164
+ // ── Helpers ────────────────────────────────────────────────────────
169
165
 
170
- /**
171
- * Compute the multibase-multihash sha2-256 checksum of `bytes`, in the
172
- * same `b<base32>` shape the registry CLI publishes
173
- * (`packages/plugin-cli/src/multihash.ts`). Returns a 56-character
174
- * string starting with `b`.
175
- *
176
- * The trust contract is: if both sides produce the same string for
177
- * the same bytes, the bytes are unchanged. We don't decode the
178
- * publisher-supplied checksum -- we just re-encode our own and compare,
179
- * which is equivalent and avoids needing a base32 decoder.
180
- */
181
- async function sha256MultibaseMultihash(bytes: Uint8Array): Promise<string> {
182
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Uint8Array is a valid BufferSource at runtime
183
- const digestBuf = await crypto.subtle.digest("SHA-256", bytes as unknown as BufferSource);
184
- const digest = new Uint8Array(digestBuf);
185
- const multihash = new Uint8Array(2 + digest.length);
186
- multihash[0] = MULTIHASH_SHA256_CODE;
187
- multihash[1] = MULTIHASH_SHA256_LENGTH;
188
- multihash.set(digest, 2);
189
- const { toBase32 } = await import("@atcute/multibase");
190
- return `b${toBase32(multihash)}`;
166
+ export function registryArtifactError(
167
+ code: RegistryArtifactVerificationCode,
168
+ message: string,
169
+ operation: "install" | "update",
170
+ ): ApiResult<never> {
171
+ let apiCode: string;
172
+ switch (code) {
173
+ case "BUNDLE_ID_MISMATCH":
174
+ apiCode = operation === "install" ? "MANIFEST_ID_MISMATCH" : "BUNDLE_IDENTITY_MISMATCH";
175
+ break;
176
+ case "BUNDLE_VERSION_MISMATCH":
177
+ apiCode = operation === "install" ? "MANIFEST_VERSION_MISMATCH" : code;
178
+ break;
179
+ case "CHECKSUM_MISMATCH":
180
+ case "INVALID_MULTIHASH":
181
+ case "UNSUPPORTED_MULTIHASH":
182
+ apiCode = "CHECKSUM_MISMATCH";
183
+ break;
184
+ case "FETCH_FAILED":
185
+ case "HOST_REJECTED":
186
+ case "REDIRECT_LIMIT_EXCEEDED":
187
+ case "REDIRECT_LOCATION_MISSING":
188
+ case "RESOURCE_STATUS_ERROR":
189
+ case "RESOURCE_TIMEOUT":
190
+ apiCode = operation === "install" ? "INSTALL_FAILED" : "UPDATE_FAILED";
191
+ break;
192
+ default:
193
+ apiCode = "INVALID_BUNDLE";
194
+ }
195
+ return {
196
+ success: false,
197
+ error: {
198
+ code: apiCode,
199
+ message,
200
+ details: { verificationCode: code },
201
+ },
202
+ };
191
203
  }
192
204
 
193
- /**
194
- * Verify that a checksum string from a release record's
195
- * `artifact.checksum` field corresponds to the SHA-256 of the given
196
- * bytes.
197
- *
198
- * Accepts two formats:
199
- *
200
- * - Bare lowercase/uppercase hex SHA-256 (64 chars). Convenience for
201
- * publishers / tools that emit hex rather than multibase.
202
- * - Multibase-multihash with the `b` (base32) prefix and sha2-256.
203
- * This is the format RFC 0001 mandates and the registry CLI emits
204
- * (see `packages/plugin-cli/src/multihash.ts`).
205
- *
206
- * Hash functions other than sha2-256 are out of scope for this
207
- * initial release; the install fails closed.
208
- */
209
- export async function verifyChecksum(bytes: Uint8Array, checksum: string): Promise<boolean> {
210
- if (SHA256_HEX_PATTERN.test(checksum)) {
211
- const actual = await sha256Hex(bytes);
212
- return checksum.toLowerCase() === actual;
213
- }
205
+ function registryRecordError(
206
+ code: AuthoritativeRecordErrorCode,
207
+ message: string,
208
+ ): ApiResult<never> {
209
+ return {
210
+ success: false,
211
+ error: {
212
+ code: "RECORD_VERIFICATION_FAILED",
213
+ message,
214
+ details: { verificationCode: code },
215
+ },
216
+ };
217
+ }
214
218
 
215
- // Multibase-base32 multihash with sha2-256. We re-encode our own
216
- // digest in the same shape and compare strings -- equivalent to
217
- // decoding and comparing bytes, but doesn't need a base32 decoder.
218
- // 56 chars = 'b' + base32(34 bytes) = 'b' + 55 chars.
219
- if (checksum.length === 56 && checksum.startsWith("b")) {
220
- const actual = await sha256MultibaseMultihash(bytes);
221
- // Case-insensitive: multibase 'b' is lowercase by convention but
222
- // some emitters use uppercase. RFC 4648 base32 alphabets are
223
- // case-insensitive.
224
- return actual.toLowerCase() === checksum.toLowerCase();
219
+ function recordConsentError(
220
+ input: { profileCid?: string; releaseCid?: string },
221
+ records: VerifiedAuthoritativeRecords,
222
+ ): ApiResult<never> | null {
223
+ if (!input.profileCid || !input.releaseCid) {
224
+ return {
225
+ success: false,
226
+ error: {
227
+ code: "RECORD_CONSENT_REQUIRED",
228
+ message: "Verify the signed package records before confirming this action.",
229
+ },
230
+ };
225
231
  }
232
+ if (input.profileCid !== records.profile.cid || input.releaseCid !== records.release.cid) {
233
+ return {
234
+ success: false,
235
+ error: {
236
+ code: "RECORD_VERIFICATION_DRIFT",
237
+ message: "The signed package records changed after review. Verify them again.",
238
+ },
239
+ };
240
+ }
241
+ return null;
242
+ }
226
243
 
227
- return false;
244
+ function recordVerificationSummary(
245
+ records: VerifiedAuthoritativeRecords,
246
+ report: VerifiedAuthoritativeReleaseReport,
247
+ ): RegistryRecordVerificationSummary {
248
+ return {
249
+ profileCid: records.profile.cid,
250
+ releaseCid: records.release.cid,
251
+ provenance: report.provenance.status,
252
+ policy: report.value.policy,
253
+ };
228
254
  }
229
255
 
230
256
  /**
@@ -281,6 +307,16 @@ const AGGREGATOR_REQUEST_TIMEOUT_MS = 15_000;
281
307
  */
282
308
  const AGGREGATOR_TOTAL_BUDGET_MS = 30_000;
283
309
 
310
+ class RegistryArtifactFetchError extends Error {
311
+ constructor(
312
+ readonly code: RegistryArtifactVerificationCode,
313
+ message: string,
314
+ ) {
315
+ super(message);
316
+ this.name = "RegistryArtifactFetchError";
317
+ }
318
+ }
319
+
284
320
  /** Build a fetch function that enforces a per-request and per-budget timeout. */
285
321
  function timedFetch(totalDeadline: number): typeof fetch {
286
322
  return (input: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => {
@@ -339,7 +375,7 @@ async function fetchArtifact(
339
375
  },
340
376
  );
341
377
  if (!result.success) {
342
- throw new Error(`Artifact retrieval failed (${result.error.code}): ${result.error.message}`);
378
+ throw new RegistryArtifactFetchError(result.error.code, result.error.message);
343
379
  }
344
380
  return result.value.bytes;
345
381
  }
@@ -398,7 +434,13 @@ export async function handleRegistryInstall(
398
434
  sandboxRunner: SandboxRunner | null,
399
435
  registryConfigInput: RegistryConfigInput | undefined,
400
436
  input: RegistryInstallInput,
401
- opts?: { configuredPluginIds?: Set<string>; hostEnv?: HostEnv },
437
+ opts?: {
438
+ configuredPluginIds?: Set<string>;
439
+ hostEnv?: HostEnv;
440
+ authoritativeRecords?: AuthoritativeRecordReadOptions;
441
+ readAuthoritativeRecords?: AuthoritativeRecordReader;
442
+ verifyOnly?: boolean;
443
+ },
402
444
  ): Promise<ApiResult<RegistryInstallResult>> {
403
445
  // Accept either the bare-string shorthand or the full
404
446
  // `RegistryConfig` object (see `RegistryConfigInput`).
@@ -428,7 +470,10 @@ export async function handleRegistryInstall(
428
470
  success: false,
429
471
  error: {
430
472
  code: "SANDBOX_NOT_AVAILABLE",
431
- message: "Sandbox runner is required for registry plugins",
473
+ message: withUnavailableReason(
474
+ "Sandbox runner is required for registry plugins",
475
+ sandboxRunner,
476
+ ),
432
477
  },
433
478
  };
434
479
  }
@@ -549,19 +594,9 @@ export async function handleRegistryInstall(
549
594
  };
550
595
  }
551
596
 
552
- // Identity cross-check on every field the aggregator denormalises
553
- // onto the package and release views. A buggy or compromised
554
- // aggregator could otherwise return a release view for a
555
- // different `(did, slug, version)` than we asked for; the
556
- // handler would then fetch + checksum-verify + install bytes
557
- // under the requested package's pluginId but for a different
558
- // publisher's record. Checksum verification only proves the bytes
559
- // match the *returned* record, not that the record belongs to
560
- // the package we requested.
561
- // `releaseView.release` is validated against the release lexicon by
562
- // DiscoveryClient (or `null` if it didn't conform). A `null` here makes
563
- // the identity checks below fail closed, which is the desired outcome.
564
- const signedRelease = releaseView.release;
597
+ // The aggregator selects the package/version and supplies mirrors and
598
+ // moderation metadata. Its copies of the signed records are not
599
+ // verification inputs.
565
600
  if (packageView.did !== publisherDid || packageView.slug !== slug) {
566
601
  return {
567
602
  success: false,
@@ -574,9 +609,7 @@ export async function handleRegistryInstall(
574
609
  if (
575
610
  releaseView.did !== publisherDid ||
576
611
  releaseView.package !== slug ||
577
- signedRelease?.package !== slug ||
578
- (requestedVersion !== undefined && releaseView.version !== requestedVersion) ||
579
- signedRelease?.version !== releaseView.version
612
+ (requestedVersion !== undefined && releaseView.version !== requestedVersion)
580
613
  ) {
581
614
  return {
582
615
  success: false,
@@ -599,6 +632,55 @@ export async function handleRegistryInstall(
599
632
  };
600
633
  }
601
634
 
635
+ const authoritative = await (opts?.readAuthoritativeRecords ?? readAuthoritativePackageRelease)(
636
+ publisherDid,
637
+ slug,
638
+ version,
639
+ opts?.authoritativeRecords,
640
+ );
641
+ if (!authoritative.success) {
642
+ return registryRecordError(authoritative.error.code, authoritative.error.message);
643
+ }
644
+ const records = authoritative.value;
645
+ const { profile, release } = records.inspection.value;
646
+ if (
647
+ packageView.uri !== records.profile.uri ||
648
+ packageView.cid !== records.profile.cid ||
649
+ releaseView.uri !== records.release.uri ||
650
+ releaseView.cid !== records.release.cid
651
+ ) {
652
+ return {
653
+ success: false,
654
+ error: {
655
+ code: "AGGREGATOR_RECORD_MISMATCH",
656
+ message: "Aggregator metadata does not match the publisher's signed records.",
657
+ },
658
+ };
659
+ }
660
+ if (!opts?.verifyOnly) {
661
+ const consentError = recordConsentError(
662
+ {
663
+ profileCid: input.acknowledgedProfileCid,
664
+ releaseCid: input.acknowledgedReleaseCid,
665
+ },
666
+ records,
667
+ );
668
+ if (consentError) return consentError;
669
+ }
670
+
671
+ const packageYanked =
672
+ hasCurrentRecordLabel(packageView.labels ?? [], "security:yanked", records.profile) ||
673
+ hasCurrentRecordLabel(packageView.labels ?? [], "security-yanked", records.profile);
674
+ if (packageYanked) {
675
+ return {
676
+ success: false,
677
+ error: {
678
+ code: "RELEASE_YANKED",
679
+ message: "This release has been withdrawn",
680
+ },
681
+ };
682
+ }
683
+
602
684
  // Environment compatibility remains an install-safety gate. Listing
603
685
  // approval says only that displayed metadata passed moderation. A release
604
686
  // may carry a `requires` block (`env:emdash`, `env:astro`, ...). Refuse
@@ -607,7 +689,7 @@ export async function handleRegistryInstall(
607
689
  // disabled Install button. `requires` is lexicon-`unknown`; the
608
690
  // helper guards its shape.
609
691
  if (opts?.hostEnv) {
610
- const envError = assertEnvCompatible(releaseView.release?.requires, opts.hostEnv);
692
+ const envError = assertEnvCompatible(release.requires, opts.hostEnv);
611
693
  if (envError) return { success: false, error: envError };
612
694
  }
613
695
 
@@ -617,13 +699,11 @@ export async function handleRegistryInstall(
617
699
  // must still hit the holdback. The `minimumReleaseAgeExclude`
618
700
  // allowlist short-circuits the check for trusted publisher DIDs.
619
701
  //
620
- // Caveat: `releaseView.indexedAt` is aggregator-supplied envelope
621
- // data, not a signed timestamp. A compromised aggregator can
622
- // claim an arbitrary indexed-at date and bypass the holdback;
623
- // closing this gap requires fetching the release record's
624
- // signed createdAt from the publisher's PDS (deferred to the
625
- // follow-up that adds full MST verification). If the timestamp
626
- // is missing or malformed, we fail closed and reject the install.
702
+ // `releaseView.indexedAt` is aggregator operational data, not part
703
+ // of the signed release. The release schema has no publication
704
+ // timestamp, so minimum age remains a local discovery holdback
705
+ // rather than a cryptographic property. A missing or malformed
706
+ // timestamp fails closed.
627
707
  // `registryConfig` is the user-supplied integration option, not
628
708
  // the normalized manifest shape, so the duration parse runs once
629
709
  // per install. Catch a malformed value here -- normally caught at
@@ -653,7 +733,9 @@ export async function handleRegistryInstall(
653
733
  const exclude = registryConfig.policy?.minimumReleaseAgeExclude?.map((e) =>
654
734
  e.trim().toLowerCase(),
655
735
  );
656
- const exempt = releaseExemptFromMinimumAge(exclude, publisherDid, slug);
736
+ const exempt =
737
+ releaseExemptFromMinimumAge(exclude, publisherDid, slug) ||
738
+ isProvenFirstRelease(packageView);
657
739
  if (!exempt) {
658
740
  const indexedAt = Date.parse(releaseView.indexedAt);
659
741
  if (!Number.isFinite(indexedAt)) {
@@ -728,13 +810,10 @@ export async function handleRegistryInstall(
728
810
  };
729
811
  }
730
812
 
731
- // Step 4: fetch the artifact bytes.
732
- // `releaseView.release` is lexicon-validated by DiscoveryClient (or
733
- // `null`); a missing source/checksum (including the `null` case) fails
734
- // closed below. Cache descriptors are unsigned aggregator operational data.
735
- const release = releaseView.release;
736
- const packageArtifact = release?.artifacts?.package;
737
- const declaredChecksum = packageArtifact?.checksum;
813
+ // Step 6: fetch bytes through an aggregator cache, the publisher PDS,
814
+ // or the URL in the authoritative signed release. Every source remains untrusted.
815
+ const packageArtifact = release.artifacts.package;
816
+ const declaredChecksum = release.artifacts.package.checksum;
738
817
 
739
818
  if (!packageArtifact || !declaredChecksum) {
740
819
  return {
@@ -746,72 +825,54 @@ export async function handleRegistryInstall(
746
825
  };
747
826
  }
748
827
 
749
- const artifactBytes = await fetchArtifact(
750
- releaseView.artifactCaches ?? [],
751
- packageArtifact,
752
- {
753
- did: publisherDid,
754
- collection: NSID.packageRelease,
755
- rkey: `${slug}:${version}`,
756
- cid: releaseView.cid,
757
- },
758
- release.auth,
759
- );
760
-
761
- // Step 5: verify the bytes against the signed record's checksum.
762
- const checksumOk = await verifyChecksum(artifactBytes, declaredChecksum);
763
- if (!checksumOk) {
764
- return {
765
- success: false,
766
- error: {
767
- code: "CHECKSUM_MISMATCH",
768
- message:
769
- "Artifact bytes do not match the release record's checksum, or the checksum encoding is unsupported.",
770
- },
771
- };
772
- }
773
-
774
- // Step 6: extract the bundle.
775
- let bundle: PluginBundle;
828
+ let artifactBytes: Uint8Array;
776
829
  try {
777
- bundle = await extractBundle(artifactBytes);
778
- } catch (err) {
779
- return {
780
- success: false,
781
- error: {
782
- code: "INVALID_BUNDLE",
783
- message: err instanceof Error ? err.message : "Failed to extract plugin bundle",
830
+ artifactBytes = await fetchArtifact(
831
+ releaseView.artifactCaches ?? [],
832
+ packageArtifact,
833
+ {
834
+ did: publisherDid,
835
+ collection: NSID.packageRelease,
836
+ rkey: `${slug}:${version}`,
837
+ cid: releaseView.cid,
784
838
  },
785
- };
839
+ release.auth,
840
+ );
841
+ } catch (error) {
842
+ if (error instanceof RegistryArtifactFetchError) {
843
+ return registryArtifactError(error.code, error.message, "install");
844
+ }
845
+ throw error;
786
846
  }
787
847
 
788
- // Manifest sanity: declared version must match the release's version.
789
- if (bundle.manifest.version !== version) {
790
- return {
791
- success: false,
792
- error: {
793
- code: "MANIFEST_VERSION_MISMATCH",
794
- message: `Bundle manifest version (${bundle.manifest.version}) does not match release version (${version})`,
795
- },
796
- };
848
+ // Steps 6-7: verify the signed checksum, archive, manifest, and
849
+ // expected package identity with the runtime-neutral verifier used
850
+ // by the release service.
851
+ const artifactReport = await validateRegistryArtifact(
852
+ artifactBytes,
853
+ declaredChecksum,
854
+ slug,
855
+ version,
856
+ );
857
+ if (!artifactReport.success) {
858
+ return registryArtifactError(
859
+ artifactReport.error.code,
860
+ artifactReport.error.message,
861
+ "install",
862
+ );
797
863
  }
798
-
799
- // Manifest identity: the bundle's `manifest.id` is the publisher's
800
- // natural plugin id (their slug). It MUST equal the slug the
801
- // install was requested for; otherwise a malicious registry bundle
802
- // could declare `manifest.id: "audit-log"` and confuse the sandbox
803
- // bridge, which uses `manifest.id` as the trust key for
804
- // per-plugin storage, cron schedules, and bridge-scoped
805
- // operations.
806
- if (bundle.manifest.id !== slug) {
807
- return {
808
- success: false,
809
- error: {
810
- code: "MANIFEST_ID_MISMATCH",
811
- message: `Bundle manifest id (${bundle.manifest.id}) does not match registry slug (${slug})`,
812
- },
813
- };
864
+ const { bundle, artifactDigest, artifactDigests } = artifactReport.value;
865
+ const recordReport = await verifyAuthoritativePackageRelease(records, artifactDigest, {
866
+ ...opts?.authoritativeRecords,
867
+ artifactDigests,
868
+ });
869
+ if (!recordReport.success) {
870
+ return registryRecordError(
871
+ recordReport.code,
872
+ recordReport.reasons[0]?.message ?? "The release provenance is invalid.",
873
+ );
814
874
  }
875
+ const verification = recordVerificationSummary(records, recordReport);
815
876
 
816
877
  // Rewrite the manifest's id to the derived opaque pluginId before
817
878
  // it reaches R2 storage or the sandbox loader. The sandbox uses
@@ -829,13 +890,8 @@ export async function handleRegistryInstall(
829
890
  // outside what the user reviewed. The capability-set consent gate below
830
891
  // is blind to constraint content (host scope), so compare the full
831
892
  // enforced access of record vs bundle here and refuse on any difference.
832
- const recordExt =
833
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- extensions is the lexicon's open `unknown` map; narrow to read our own extension
834
- (release?.extensions as Record<string, { declaredAccess?: DeclaredAccess }> | undefined)?.[
835
- RELEASE_EXTENSION_NSID
836
- ];
837
893
  if (
838
- !enforcedAccessEqual(recordExt?.declaredAccess ?? {}, bundle.manifest.declaredAccess ?? {})
894
+ !verifiedAccessEqual(recordReport.value.declaredAccess, bundle.manifest.declaredAccess ?? {})
839
895
  ) {
840
896
  return {
841
897
  success: false,
@@ -849,13 +905,9 @@ export async function handleRegistryInstall(
849
905
 
850
906
  // Capability consent gate: the admin MUST acknowledge the
851
907
  // capabilities the bundle's manifest actually declares before we
852
- // install it. The bundle manifest is the only source of truth
853
- // the runtime sandbox enforces -- the release record's
854
- // `declaredAccess` extension is an aggregator-supplied
855
- // assertion that the publisher may or may not have included,
856
- // and trusting it would let a malicious publisher (or a
857
- // compromised aggregator) ship a bundle whose manifest
858
- // requests `content:*` etc. behind an empty consent dialog.
908
+ // install it. The bundle manifest is the runtime enforcement
909
+ // currency; the exact-equality check above binds it to the
910
+ // independently verified signed release.
859
911
  //
860
912
  // Two outcomes after normalization (filter to strings, dedupe,
861
913
  // sort):
@@ -872,7 +924,7 @@ export async function handleRegistryInstall(
872
924
  // the runtime starts enforcing `declaredAccess` natively, this
873
925
  // comparison switches to that shape.
874
926
  const actualCapabilities = canonicalCapabilitiesForDriftCheck(bundle.manifest.capabilities);
875
- if (actualCapabilities.length > 0) {
927
+ if (!opts?.verifyOnly && actualCapabilities.length > 0) {
876
928
  if (input.acknowledgedDeclaredAccess === undefined) {
877
929
  return {
878
930
  success: false,
@@ -902,19 +954,31 @@ export async function handleRegistryInstall(
902
954
  const actualMcpTools = (bundle.manifest.mcp?.tools ?? []).map(
903
955
  ({ inputSchema: _, outputSchema: __, ...tool }) => tool,
904
956
  );
905
- if (actualMcpTools.length > 0) {
957
+ if (!opts?.verifyOnly && actualMcpTools.length > 0) {
906
958
  if (JSON.stringify(input.acknowledgedMcpTools) !== JSON.stringify(actualMcpTools)) {
907
959
  return {
908
960
  success: false,
909
961
  error: {
910
962
  code: "MCP_TOOL_CONSENT_REQUIRED",
911
963
  message: "Plugin MCP tools require explicit consent",
912
- details: { mcpTools: actualMcpTools },
964
+ details: { mcpTools: actualMcpTools, verification },
913
965
  },
914
966
  };
915
967
  }
916
968
  }
917
969
 
970
+ const result: RegistryInstallResult = {
971
+ pluginId,
972
+ publisherDid,
973
+ slug,
974
+ version,
975
+ capabilities: bundle.manifest.capabilities,
976
+ declaredAccess: recordReport.value.releaseExtension.declaredAccess,
977
+ mcpTools: actualMcpTools,
978
+ verification,
979
+ };
980
+ if (opts?.verifyOnly) return { success: true, data: result };
981
+
918
982
  // Step 7: store in R2 under the registry prefix.
919
983
  await storeBundleInR2(storage, pluginId, version, bundle, "registry");
920
984
 
@@ -947,13 +1011,11 @@ export async function handleRegistryInstall(
947
1011
  // Cleanup is best-effort; if it also fails, the row failure
948
1012
  // still surfaces to the caller and the orphan R2 bundle costs
949
1013
  // only the storage of a single checksum-verified zip.
950
- // `packageView.profile` is lexicon-validated by DiscoveryClient (or null).
951
- const profile = packageView.profile;
952
1014
  try {
953
1015
  await stateRepo.upsert(pluginId, version, "active", {
954
1016
  source: "registry",
955
- displayName: profile?.name ?? slug,
956
- description: profile?.description ?? undefined,
1017
+ displayName: profile.name ?? slug,
1018
+ description: profile.description ?? undefined,
957
1019
  registryPublisherDid: publisherDid,
958
1020
  registrySlug: slug,
959
1021
  });
@@ -985,13 +1047,7 @@ export async function handleRegistryInstall(
985
1047
 
986
1048
  return {
987
1049
  success: true,
988
- data: {
989
- pluginId,
990
- publisherDid,
991
- slug,
992
- version,
993
- capabilities: bundle.manifest.capabilities,
994
- },
1050
+ data: result,
995
1051
  };
996
1052
  } catch (err) {
997
1053
  if (err instanceof ClientValidationError) {
@@ -1129,6 +1185,7 @@ export interface RegistryUpdateResult {
1129
1185
  capabilityChanges: { added: string[]; removed: string[] };
1130
1186
  /** Set only when `newlyPublic` is non-empty, mirroring marketplace. */
1131
1187
  routeVisibilityChanges?: { newlyPublic: string[] };
1188
+ verification: RegistryRecordVerificationSummary;
1132
1189
  }
1133
1190
 
1134
1191
  /**
@@ -1153,7 +1210,11 @@ export async function handleRegistryUpdate(
1153
1210
  confirmCapabilityChanges?: boolean;
1154
1211
  confirmRouteVisibilityChanges?: boolean;
1155
1212
  confirmMcpTools?: boolean;
1213
+ acknowledgedProfileCid?: string;
1214
+ acknowledgedReleaseCid?: string;
1156
1215
  hostEnv?: HostEnv;
1216
+ authoritativeRecords?: AuthoritativeRecordReadOptions;
1217
+ readAuthoritativeRecords?: AuthoritativeRecordReader;
1157
1218
  },
1158
1219
  ): Promise<ApiResult<RegistryUpdateResult>> {
1159
1220
  const registryConfig = coerceRegistryConfig(registryConfigInput);
@@ -1175,7 +1236,10 @@ export async function handleRegistryUpdate(
1175
1236
  if (!sandboxRunner || !sandboxRunner.isAvailable()) {
1176
1237
  return {
1177
1238
  success: false,
1178
- error: { code: "SANDBOX_NOT_AVAILABLE", message: "Sandbox runner is required" },
1239
+ error: {
1240
+ code: "SANDBOX_NOT_AVAILABLE",
1241
+ message: withUnavailableReason("Sandbox runner is required", sandboxRunner),
1242
+ },
1179
1243
  };
1180
1244
  }
1181
1245
  try {
@@ -1264,16 +1328,12 @@ export async function handleRegistryUpdate(
1264
1328
  };
1265
1329
  }
1266
1330
 
1267
- // Identity cross-check. A buggy/compromised aggregator must not
1268
- // trick us into installing a record signed for a different
1269
- // (did, slug, version) under this plugin's pluginId.
1270
- const signedRelease = releaseView.release;
1331
+ // The aggregator selects the target version and supplies mirrors and
1332
+ // moderation metadata. Its release-record copy is not trusted.
1271
1333
  if (
1272
1334
  releaseView.did !== publisherDid ||
1273
1335
  releaseView.package !== slug ||
1274
- signedRelease?.package !== slug ||
1275
- (opts?.version !== undefined && releaseView.version !== opts.version) ||
1276
- signedRelease?.version !== releaseView.version
1336
+ (opts?.version !== undefined && releaseView.version !== opts.version)
1277
1337
  ) {
1278
1338
  return {
1279
1339
  success: false,
@@ -1284,6 +1344,16 @@ export async function handleRegistryUpdate(
1284
1344
  },
1285
1345
  };
1286
1346
  }
1347
+ const packageView = await discovery.getPackage({ did: publisherDid, slug });
1348
+ if (!packageView || packageView.did !== publisherDid || packageView.slug !== slug) {
1349
+ return {
1350
+ success: false,
1351
+ error: {
1352
+ code: "AGGREGATOR_IDENTITY_MISMATCH",
1353
+ message: "Aggregator returned a package view that does not match the installed plugin.",
1354
+ },
1355
+ };
1356
+ }
1287
1357
 
1288
1358
  const newVersion = releaseView.version;
1289
1359
  if (evaluateRegistryReleaseWithdrawal(releaseView, discovery.labelerPolicy).withdrawn) {
@@ -1301,17 +1371,64 @@ export async function handleRegistryUpdate(
1301
1371
  },
1302
1372
  };
1303
1373
  }
1304
-
1374
+ const authoritative = await (opts?.readAuthoritativeRecords ?? readAuthoritativePackageRelease)(
1375
+ publisherDid,
1376
+ slug,
1377
+ newVersion,
1378
+ opts?.authoritativeRecords,
1379
+ );
1380
+ if (!authoritative.success) {
1381
+ return registryRecordError(authoritative.error.code, authoritative.error.message);
1382
+ }
1383
+ const records = authoritative.value;
1384
+ const { profile, release } = records.inspection.value;
1385
+ if (
1386
+ packageView.uri !== records.profile.uri ||
1387
+ packageView.cid !== records.profile.cid ||
1388
+ releaseView.uri !== records.release.uri ||
1389
+ releaseView.cid !== records.release.cid
1390
+ ) {
1391
+ return {
1392
+ success: false,
1393
+ error: {
1394
+ code: "AGGREGATOR_RECORD_MISMATCH",
1395
+ message: "Aggregator metadata does not match the publisher's signed records.",
1396
+ },
1397
+ };
1398
+ }
1399
+ const packageYanked =
1400
+ hasCurrentRecordLabel(packageView.labels ?? [], "security:yanked", records.profile) ||
1401
+ hasCurrentRecordLabel(packageView.labels ?? [], "security-yanked", records.profile);
1402
+ if (packageYanked) {
1403
+ return {
1404
+ success: false,
1405
+ error: { code: "YANKED", message: "Package has been withdrawn" },
1406
+ };
1407
+ }
1408
+ if (
1409
+ opts?.confirmCapabilityChanges ||
1410
+ opts?.confirmRouteVisibilityChanges ||
1411
+ opts?.confirmMcpTools
1412
+ ) {
1413
+ const consentError = recordConsentError(
1414
+ {
1415
+ profileCid: opts.acknowledgedProfileCid,
1416
+ releaseCid: opts.acknowledgedReleaseCid,
1417
+ },
1418
+ records,
1419
+ );
1420
+ if (consentError) return consentError;
1421
+ }
1305
1422
  // Environment compatibility remains independent from listing approval.
1306
1423
  // An ungated update could otherwise
1307
1424
  // land a version whose `requires` the host doesn't satisfy. Same
1308
1425
  // guard as install; `requires` is lexicon-`unknown`.
1309
1426
  if (opts?.hostEnv) {
1310
- const envError = assertEnvCompatible(signedRelease.requires, opts.hostEnv);
1427
+ const envError = assertEnvCompatible(release.requires, opts.hostEnv);
1311
1428
  if (envError) return { success: false, error: envError };
1312
1429
  }
1313
1430
 
1314
- const packageArtifact = signedRelease.artifacts?.package;
1431
+ const packageArtifact = release.artifacts.package;
1315
1432
  const declaredChecksum = packageArtifact?.checksum;
1316
1433
  if (!packageArtifact || !declaredChecksum) {
1317
1434
  return {
@@ -1323,47 +1440,50 @@ export async function handleRegistryUpdate(
1323
1440
  };
1324
1441
  }
1325
1442
 
1326
- const artifactBytes = await fetchArtifact(
1327
- releaseView.artifactCaches ?? [],
1328
- packageArtifact,
1329
- {
1330
- did: publisherDid,
1331
- collection: NSID.packageRelease,
1332
- rkey: `${slug}:${newVersion}`,
1333
- cid: releaseView.cid,
1334
- },
1335
- signedRelease.auth,
1336
- );
1337
- if (!(await verifyChecksum(artifactBytes, declaredChecksum))) {
1338
- return {
1339
- success: false,
1340
- error: {
1341
- code: "CHECKSUM_MISMATCH",
1342
- message: "Artifact bytes do not match the release's published checksum",
1443
+ let artifactBytes: Uint8Array;
1444
+ try {
1445
+ artifactBytes = await fetchArtifact(
1446
+ releaseView.artifactCaches ?? [],
1447
+ packageArtifact,
1448
+ {
1449
+ did: publisherDid,
1450
+ collection: NSID.packageRelease,
1451
+ rkey: `${slug}:${newVersion}`,
1452
+ cid: releaseView.cid,
1343
1453
  },
1344
- };
1454
+ release.auth,
1455
+ );
1456
+ } catch (error) {
1457
+ if (error instanceof RegistryArtifactFetchError) {
1458
+ return registryArtifactError(error.code, error.message, "update");
1459
+ }
1460
+ throw error;
1345
1461
  }
1346
-
1347
- const bundle: PluginBundle = await extractBundle(artifactBytes);
1348
-
1349
- if (bundle.manifest.version !== newVersion) {
1350
- return {
1351
- success: false,
1352
- error: {
1353
- code: "BUNDLE_VERSION_MISMATCH",
1354
- message: `Bundle manifest version (${bundle.manifest.version}) does not match release version (${newVersion})`,
1355
- },
1356
- };
1462
+ const artifactReport = await validateRegistryArtifact(
1463
+ artifactBytes,
1464
+ declaredChecksum,
1465
+ slug,
1466
+ newVersion,
1467
+ );
1468
+ if (!artifactReport.success) {
1469
+ return registryArtifactError(
1470
+ artifactReport.error.code,
1471
+ artifactReport.error.message,
1472
+ "update",
1473
+ );
1357
1474
  }
1358
- if (bundle.manifest.id !== slug) {
1359
- return {
1360
- success: false,
1361
- error: {
1362
- code: "BUNDLE_IDENTITY_MISMATCH",
1363
- message: `Bundle manifest id (${bundle.manifest.id}) does not match registry slug (${slug})`,
1364
- },
1365
- };
1475
+ const { bundle, artifactDigest, artifactDigests } = artifactReport.value;
1476
+ const recordReport = await verifyAuthoritativePackageRelease(records, artifactDigest, {
1477
+ ...opts?.authoritativeRecords,
1478
+ artifactDigests,
1479
+ });
1480
+ if (!recordReport.success) {
1481
+ return registryRecordError(
1482
+ recordReport.code,
1483
+ recordReport.reasons[0]?.message ?? "The release provenance is invalid.",
1484
+ );
1366
1485
  }
1486
+ const verification = recordVerificationSummary(records, recordReport);
1367
1487
 
1368
1488
  // Rewrite manifest.id to the opaque pluginId so the sandbox loader
1369
1489
  // and R2 layout stay in sync across install and update.
@@ -1374,13 +1494,8 @@ export async function handleRegistryUpdate(
1374
1494
  // that changes only the host scope (e.g. api.good.com -> evil.com) keeps
1375
1495
  // the capability set identical, sails through the escalation diff below,
1376
1496
  // and installs a bundle enforcing a scope the record never showed.
1377
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- extensions is the lexicon's open `unknown` map; narrow to read our own extension
1378
- const updateRecordExtensions = signedRelease?.extensions as
1379
- | Record<string, { declaredAccess?: DeclaredAccess }>
1380
- | undefined;
1381
- const recordExt = updateRecordExtensions?.[RELEASE_EXTENSION_NSID];
1382
1497
  if (
1383
- !enforcedAccessEqual(recordExt?.declaredAccess ?? {}, bundle.manifest.declaredAccess ?? {})
1498
+ !verifiedAccessEqual(recordReport.value.declaredAccess, bundle.manifest.declaredAccess ?? {})
1384
1499
  ) {
1385
1500
  return {
1386
1501
  success: false,
@@ -1406,7 +1521,7 @@ export async function handleRegistryUpdate(
1406
1521
  error: {
1407
1522
  code: "CAPABILITY_ESCALATION",
1408
1523
  message: "Plugin update requires new capabilities",
1409
- details: { capabilityChanges },
1524
+ details: { capabilityChanges, verification },
1410
1525
  },
1411
1526
  };
1412
1527
  }
@@ -1419,7 +1534,7 @@ export async function handleRegistryUpdate(
1419
1534
  error: {
1420
1535
  code: "ROUTE_VISIBILITY_ESCALATION",
1421
1536
  message: "Plugin update exposes new public (unauthenticated) routes",
1422
- details: { routeVisibilityChanges, capabilityChanges },
1537
+ details: { routeVisibilityChanges, capabilityChanges, verification },
1423
1538
  },
1424
1539
  };
1425
1540
  }
@@ -1438,6 +1553,7 @@ export async function handleRegistryUpdate(
1438
1553
  message: "Plugin update changes its MCP tools",
1439
1554
  details: {
1440
1555
  mcpTools: newMcpTools.map(({ inputSchema: _, outputSchema: __, ...tool }) => tool),
1556
+ verification,
1441
1557
  },
1442
1558
  },
1443
1559
  };
@@ -1447,28 +1563,20 @@ export async function handleRegistryUpdate(
1447
1563
  // so a retry of the same update is idempotent.
1448
1564
  await storeBundleInR2(storage, pluginId, newVersion, bundle, "registry");
1449
1565
 
1450
- // Update state. Preserve publisher/slug; refresh displayName /
1451
- // description from the install handler's seeded values (we don't
1452
- // re-fetch the profile here — that's a separate `getPackage` round
1453
- // trip and the install-time values are still authoritative for
1454
- // the same package identity).
1566
+ // Refresh display metadata from the same signed profile used for
1567
+ // release-policy verification.
1455
1568
  await stateRepo.upsert(pluginId, newVersion, "active", {
1456
1569
  source: "registry",
1457
1570
  registryPublisherDid: publisherDid,
1458
1571
  registrySlug: slug,
1459
- displayName: existing.displayName ?? slug,
1460
- description: existing.description ?? undefined,
1572
+ displayName: profile.name ?? slug,
1573
+ description: profile.description ?? undefined,
1461
1574
  mcpToolsEnabled: false,
1462
1575
  mcpToolsConsent: null,
1463
1576
  });
1464
1577
 
1465
1578
  await syncDeclaredStorageIndexes(db, [bundle.manifest]);
1466
1579
 
1467
- // Best-effort cleanup of the old bundle. Failures here don't roll
1468
- // back the upgrade (the new bundle is already stored and committed
1469
- // in the state row); the orphan is just storage we'll pay for.
1470
- deleteBundleFromR2(storage, pluginId, oldVersion, "registry").catch(() => {});
1471
-
1472
1580
  return {
1473
1581
  success: true,
1474
1582
  data: {
@@ -1477,6 +1585,7 @@ export async function handleRegistryUpdate(
1477
1585
  newVersion,
1478
1586
  capabilityChanges,
1479
1587
  routeVisibilityChanges: hasNewPublicRoutes ? routeVisibilityChanges : undefined,
1588
+ verification,
1480
1589
  },
1481
1590
  };
1482
1591
  } catch (err) {