emdash 0.28.1 → 0.30.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.
- package/dist/{adapters-hUy8vOB-.d.mts → adapters-C0ONzkUP.d.mts} +10 -1
- package/dist/adapters-C0ONzkUP.d.mts.map +1 -0
- package/dist/{allowed-origins-CRsJ6BPM.mjs → allowed-origins-CCEi9bPI.mjs} +2 -2
- package/dist/{allowed-origins-CRsJ6BPM.mjs.map → allowed-origins-CCEi9bPI.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +22 -21
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -4
- package/dist/{api-DxFSorgk.mjs → api-b8WIiGU4.mjs} +306 -154
- package/dist/api-b8WIiGU4.mjs.map +1 -0
- package/dist/api-tokens-Cvmixds7.mjs +3 -0
- package/dist/{api-tokens-DvqeZmVq.mjs → api-tokens-uPt8UDpx.mjs} +2 -2
- package/dist/{api-tokens-DvqeZmVq.mjs.map → api-tokens-uPt8UDpx.mjs.map} +1 -1
- package/dist/{apply-CDJqIjPU.mjs → apply-CmIJK9j8.mjs} +35 -38
- package/dist/apply-CmIJK9j8.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +97 -13
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +56 -107
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +7 -7
- package/dist/astro/middleware/request-context.d.mts +3 -0
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +258 -31
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +47 -3
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +379 -117
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/PluginRegistry.d.mts +5 -1
- package/dist/astro/routes/PluginRegistry.d.mts.map +1 -1
- package/dist/astro/routes/PluginRegistry.mjs +2 -1
- package/dist/astro/routes/PluginRegistry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +7 -7
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +11 -10
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +11 -10
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +11 -10
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +18 -17
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +19 -24
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +18 -17
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +11 -10
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/index.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/index.mjs +11 -10
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- package/dist/astro/routes/api/admin/media-usage/repair.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/repair.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +30 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +44 -41
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +44 -41
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +49 -41
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +39 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.d.mts +9 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +78 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +43 -40
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +46 -41
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +49 -41
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +43 -40
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +49 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +43 -40
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +43 -40
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +43 -40
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +48 -43
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +44 -41
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +43 -40
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +4 -4
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +43 -40
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +10 -9
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +6 -6
- package/dist/astro/routes/api/admin/users/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/accept.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/complete.mjs +14 -13
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +11 -10
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +13 -12
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +13 -12
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +5 -5
- package/dist/astro/routes/api/auth/me.mjs +9 -8
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +6 -3
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +16 -6
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +11 -5
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +8 -7
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +14 -13
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +13 -12
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +4 -4
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +70 -14
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +14 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -4
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +14 -13
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +10 -8
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts +9 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +72 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +51 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -4
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +10 -8
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +20 -19
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -9
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.mjs +12 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +8 -8
- package/dist/astro/routes/api/dev/emails.mjs +4 -4
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +19 -18
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +16 -16
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +12 -11
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +12 -11
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -16
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +12 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +19 -18
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +29 -28
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +8 -9
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +165 -52
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +10 -9
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/usage.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/usage.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/usage.mjs +37 -0
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +26 -10
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +4 -3
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +11 -10
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.d.mts.map +1 -1
- package/dist/astro/routes/api/media.mjs +34 -14
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +10 -9
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +7 -8
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
- package/dist/astro/routes/api/oauth/token.mjs +7 -7
- package/dist/astro/routes/api/openapi.json.mjs +71 -24
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +20 -32
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +13 -12
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +13 -12
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +14 -13
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +14 -13
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.d.mts +10 -0
- package/dist/astro/routes/api/relations/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/relations/_id_/index.mjs +70 -0
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/relations/_id_/translations.d.mts +8 -0
- package/dist/astro/routes/api/relations/_id_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/relations/_id_/translations.mjs +34 -0
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/relations/index.d.mts +9 -0
- package/dist/astro/routes/api/relations/index.d.mts.map +1 -0
- package/dist/astro/routes/api/relations/index.mjs +54 -0
- package/dist/astro/routes/api/relations/index.mjs.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +43 -40
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +43 -40
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +43 -40
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +43 -40
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +43 -40
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +9 -9
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +43 -40
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +43 -40
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +13 -12
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +14 -12
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +13 -12
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +8 -8
- package/dist/astro/routes/api/search/suggest.mjs +12 -11
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +12 -11
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +12 -11
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.d.mts +9 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +48 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/index.d.mts +8 -0
- package/dist/astro/routes/api/settings/backups/archives/index.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +23 -0
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/export.d.mts +8 -0
- package/dist/astro/routes/api/settings/backups/export.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/export.mjs +35 -0
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/index.d.mts +9 -0
- package/dist/astro/routes/api/settings/backups/index.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/index.mjs +52 -0
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +16 -15
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +20 -16
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +19 -15
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +29 -29
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.mjs +31 -30
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -5
- package/dist/astro/routes/api/snapshot.mjs +9 -216
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +7 -7
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts.map +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +4 -3
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs.map +1 -1
- package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts.map +1 -1
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +4 -3
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +9 -8
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +8 -8
- package/dist/astro/routes/api/widget-areas/index.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +9 -9
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +12 -12
- package/dist/astro/routes/sitemap.xml.mjs +10 -10
- package/dist/astro/types.d.mts +40 -16
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-Dz88F_Fw.mjs → authorize-WxsiePzy.mjs} +7 -4
- package/dist/authorize-WxsiePzy.mjs.map +1 -0
- package/dist/backup-S8kFWtwD.mjs +241 -0
- package/dist/backup-S8kFWtwD.mjs.map +1 -0
- package/dist/{base64-CmWvODNW.mjs → base64-B-PsqheR.mjs} +8 -4
- package/dist/base64-B-PsqheR.mjs.map +1 -0
- package/dist/{byline-Bm8ZgUP9.mjs → byline-XEjchwzZ.mjs} +8 -8
- package/dist/{byline-Bm8ZgUP9.mjs.map → byline-XEjchwzZ.mjs.map} +1 -1
- package/dist/{byline-fields-CIx_GuN4.mjs → byline-fields-CdU_LTF1.mjs} +2 -2
- package/dist/{byline-fields-CIx_GuN4.mjs.map → byline-fields-CdU_LTF1.mjs.map} +1 -1
- package/dist/{byline-registry-BOjqDOim.mjs → byline-registry-BCuOp4UF.mjs} +3 -3
- package/dist/{byline-registry-BOjqDOim.mjs.map → byline-registry-BCuOp4UF.mjs.map} +1 -1
- package/dist/{bylines-6tm9mgQb.mjs → bylines-BJbT4gKS.mjs} +4 -4
- package/dist/{bylines-6tm9mgQb.mjs.map → bylines-BJbT4gKS.mjs.map} +1 -1
- package/dist/{bylines-CAZxGSrm.mjs → bylines-czseViYo.mjs} +8 -8
- package/dist/{bylines-CAZxGSrm.mjs.map → bylines-czseViYo.mjs.map} +1 -1
- package/dist/{cache-CEBAZjir.mjs → cache-CGCd6AVM.mjs} +3 -3
- package/dist/{cache-CEBAZjir.mjs.map → cache-CGCd6AVM.mjs.map} +1 -1
- package/dist/{challenge-store-anhwVER0.mjs → challenge-store-BFzgFRog.mjs} +1 -1
- package/dist/{challenge-store-anhwVER0.mjs.map → challenge-store-BFzgFRog.mjs.map} +1 -1
- package/dist/{chunks-B2isWQhr.mjs → chunks-BxXyunY-.mjs} +2 -2
- package/dist/{chunks-B2isWQhr.mjs.map → chunks-BxXyunY-.mjs.map} +1 -1
- package/dist/cli/index.mjs +142 -35
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +86 -3
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +20 -4
- package/dist/client/index.mjs.map +1 -1
- package/dist/{comment-CzeatwBV.mjs → comment-DPT0WKyd.mjs} +2 -2
- package/dist/{comment-CzeatwBV.mjs.map → comment-DPT0WKyd.mjs.map} +1 -1
- package/dist/{comment-reaction-Cj9QJY7I.mjs → comment-reaction-C65MldIB.mjs} +2 -2
- package/dist/{comment-reaction-Cj9QJY7I.mjs.map → comment-reaction-C65MldIB.mjs.map} +1 -1
- package/dist/{comments-BLE-jv5k.mjs → comments-Bz6sCbgD.mjs} +3 -3
- package/dist/{comments-BLE-jv5k.mjs.map → comments-Bz6sCbgD.mjs.map} +1 -1
- package/dist/{components-B_sATNUc.mjs → components-DZkL4Fx0.mjs} +1 -1
- package/dist/{components-B_sATNUc.mjs.map → components-DZkL4Fx0.mjs.map} +1 -1
- package/dist/{content-DhgEth4k.mjs → content-Ci04z2z-.mjs} +227 -34
- package/dist/content-Ci04z2z-.mjs.map +1 -0
- package/dist/{content-refresh-Br4gMzh8.mjs → content-refresh-D4khvC0R.mjs} +100 -8
- package/dist/content-refresh-D4khvC0R.mjs.map +1 -0
- package/dist/{context-BRIpHARC.mjs → context-B6hc7zJL.mjs} +156 -76
- package/dist/context-B6hc7zJL.mjs.map +1 -0
- package/dist/{cron-v4FTEFR_.mjs → cron-BlKIMD_e.mjs} +1 -1
- package/dist/{cron-v4FTEFR_.mjs.map → cron-BlKIMD_e.mjs.map} +1 -1
- package/dist/{dashboard-EvEKF5en.mjs → dashboard-C5NkXFbi.mjs} +6 -5
- package/dist/dashboard-C5NkXFbi.mjs.map +1 -0
- package/dist/database/pg-migration-lock.d.mts +21 -0
- package/dist/database/pg-migration-lock.d.mts.map +1 -0
- package/dist/database/pg-migration-lock.mjs +45 -0
- package/dist/database/pg-migration-lock.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +2 -2
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/postgres.d.mts.map +1 -1
- package/dist/db/postgres.mjs +2 -8
- package/dist/db/postgres.mjs.map +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{db-errors-CK46D-ly.mjs → db-errors-CcWLaRiR.mjs} +4 -2
- package/dist/db-errors-CcWLaRiR.mjs.map +1 -0
- package/dist/{default-CM_D83Mg.mjs → default-C4v9KP56.mjs} +1 -1
- package/dist/{default-CM_D83Mg.mjs.map → default-C4v9KP56.mjs.map} +1 -1
- package/dist/{device-flow-CfGP18Uw.mjs → device-flow-BeA6lUS1.mjs} +6 -7
- package/dist/device-flow-BeA6lUS1.mjs.map +1 -0
- package/dist/dialect-helpers-HxEQGl_1.mjs +175 -0
- package/dist/dialect-helpers-HxEQGl_1.mjs.map +1 -0
- package/dist/{email-console-CIf4Lfvv.mjs → email-console-C-9Ng8DM.mjs} +1 -1
- package/dist/{email-console-CIf4Lfvv.mjs.map → email-console-C-9Ng8DM.mjs.map} +1 -1
- package/dist/{enrich-BQ0mxJRs.mjs → enrich-CFJJgxs_.mjs} +2 -2
- package/dist/{enrich-BQ0mxJRs.mjs.map → enrich-CFJJgxs_.mjs.map} +1 -1
- package/dist/error-CEGF6UZb.mjs +90 -0
- package/dist/error-CEGF6UZb.mjs.map +1 -0
- package/dist/{error-CkAseSqZ.mjs → errors-DtEXIQQV.mjs} +24 -84
- package/dist/errors-DtEXIQQV.mjs.map +1 -0
- package/dist/{escape-DqD0aCKu.mjs → escape-CFedIB1C.mjs} +1 -1
- package/dist/{escape-DqD0aCKu.mjs.map → escape-CFedIB1C.mjs.map} +1 -1
- package/dist/{field-defs-cache-WUI88LX5.mjs → field-defs-cache-DvmlgP-D.mjs} +5 -5
- package/dist/{field-defs-cache-WUI88LX5.mjs.map → field-defs-cache-DvmlgP-D.mjs.map} +1 -1
- package/dist/{fts-manager-BbFaF_V8.mjs → fts-manager-DzqIBrrW.mjs} +27 -3
- package/dist/{fts-manager-BbFaF_V8.mjs.map → fts-manager-DzqIBrrW.mjs.map} +1 -1
- package/dist/{hash-DrvzIXcz.mjs → hash-DFFrkivP.mjs} +1 -1
- package/dist/{hash-DrvzIXcz.mjs.map → hash-DFFrkivP.mjs.map} +1 -1
- package/dist/hreflang-CIxH_LKz.d.mts +48 -0
- package/dist/hreflang-CIxH_LKz.d.mts.map +1 -0
- package/dist/hreflang-db2Tpb2o.mjs +102 -0
- package/dist/hreflang-db2Tpb2o.mjs.map +1 -0
- package/dist/{import-fYLf14Co.mjs → import-Dmkm8S1W.mjs} +6 -6
- package/dist/{import-fYLf14Co.mjs.map → import-Dmkm8S1W.mjs.map} +1 -1
- package/dist/{index-Bm-Gy8Mh.d.mts → index-BEui-cRd.d.mts} +3 -3
- package/dist/{index-Bm-Gy8Mh.d.mts.map → index-BEui-cRd.d.mts.map} +1 -1
- package/dist/{index-B9sIxwe4.d.mts → index-wYnC6u4o.d.mts} +881 -22
- package/dist/index-wYnC6u4o.d.mts.map +1 -0
- package/dist/index.d.mts +19 -19
- package/dist/index.mjs +69 -64
- package/dist/{init-lock-6b309ZrF.mjs → init-lock-DJkX6Hto.mjs} +1 -1
- package/dist/{init-lock-6b309ZrF.mjs.map → init-lock-DJkX6Hto.mjs.map} +1 -1
- package/dist/{load-Djn3HWQS.mjs → load-Cx27ki1l.mjs} +2 -2
- package/dist/{load-Djn3HWQS.mjs.map → load-Cx27ki1l.mjs.map} +1 -1
- package/dist/{loader-CB6YHeul.mjs → loader-Be3ouI5L.mjs} +170 -21
- package/dist/loader-Be3ouI5L.mjs.map +1 -0
- package/dist/{manifest-schema-BHlgZM1W.mjs → manifest-schema-bCq54i7F.mjs} +18 -2
- package/dist/manifest-schema-bCq54i7F.mjs.map +1 -0
- package/dist/media/image-endpoint.d.mts +30 -2
- package/dist/media/image-endpoint.d.mts.map +1 -1
- package/dist/media/image-endpoint.mjs +30 -4
- package/dist/media/image-endpoint.mjs.map +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +8 -8
- package/dist/{media-BrXIaMFN.mjs → media-BjhhENaJ.mjs} +2 -2
- package/dist/media-BjhhENaJ.mjs.map +1 -0
- package/dist/{media-allowlist-CRHEeJ_i.mjs → media-allowlist-jUppPWFy.mjs} +2 -2
- package/dist/{media-allowlist-CRHEeJ_i.mjs.map → media-allowlist-jUppPWFy.mjs.map} +1 -1
- package/dist/media-kIV1IxFf.mjs +243 -0
- package/dist/media-kIV1IxFf.mjs.map +1 -0
- package/dist/media-upload-D2wk3EIt.mjs +145 -0
- package/dist/media-upload-D2wk3EIt.mjs.map +1 -0
- package/dist/{media-url-CKi5XSw4.mjs → media-url-BCm5vBn6.mjs} +1 -1
- package/dist/{media-url-CKi5XSw4.mjs.map → media-url-BCm5vBn6.mjs.map} +1 -1
- package/dist/media-usage-CljdO1mc.mjs +554 -0
- package/dist/media-usage-CljdO1mc.mjs.map +1 -0
- package/dist/{menus-b2T4clbO.mjs → menus-BcyElFtI.mjs} +177 -15
- package/dist/menus-BcyElFtI.mjs.map +1 -0
- package/dist/{menus-Cfivc2Ad.mjs → menus-CZyG6rvx.mjs} +3 -3
- package/dist/{menus-Cfivc2Ad.mjs.map → menus-CZyG6rvx.mjs.map} +1 -1
- package/dist/{mime-CCEzze7W.mjs → mime-DfIVjNkr.mjs} +1 -1
- package/dist/{mime-CCEzze7W.mjs.map → mime-DfIVjNkr.mjs.map} +1 -1
- package/dist/{mode-BM9QgEmt.mjs → mode-fiXRMfeA.mjs} +1 -1
- package/dist/{mode-BM9QgEmt.mjs.map → mode-fiXRMfeA.mjs.map} +1 -1
- package/dist/{normalize-CeglrBT9.mjs → normalize-C-SHXmra.mjs} +1 -1
- package/dist/{normalize-CeglrBT9.mjs.map → normalize-C-SHXmra.mjs.map} +1 -1
- package/dist/{oauth-authorization-CXWkIGT4.mjs → oauth-authorization-oqfbBuMH.mjs} +6 -7
- package/dist/oauth-authorization-oqfbBuMH.mjs.map +1 -0
- package/dist/{oauth-clients-BmTI5rsl.mjs → oauth-clients-BlrUHAsf.mjs} +1 -1
- package/dist/{oauth-clients-BmTI5rsl.mjs.map → oauth-clients-BlrUHAsf.mjs.map} +1 -1
- package/dist/{oauth-state-store-YLFLcH5F.mjs → oauth-state-store-DnvjRMy6.mjs} +2 -1
- package/dist/{oauth-state-store-YLFLcH5F.mjs.map → oauth-state-store-DnvjRMy6.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-Bsc_GsX-.mjs → oauth-user-lookup-oUllxvAv.mjs} +1 -1
- package/dist/{oauth-user-lookup-Bsc_GsX-.mjs.map → oauth-user-lookup-oUllxvAv.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-DTTML-Tx.mjs → options-BlmBHTvX.mjs} +1 -1
- package/dist/{options-DTTML-Tx.mjs.map → options-BlmBHTvX.mjs.map} +1 -1
- package/dist/{options-iMpRRxIe.d.mts → options-BqMkWfYa.d.mts} +6 -6
- package/dist/{options-iMpRRxIe.d.mts.map → options-BqMkWfYa.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs.map +1 -1
- package/dist/{parse-GmjecGct.mjs → parse-C_-6klII.mjs} +4 -12
- package/dist/{parse-GmjecGct.mjs.map → parse-C_-6klII.mjs.map} +1 -1
- package/dist/{passkey-config-De0ahnRg.mjs → passkey-config-C-SKpc0-.mjs} +1 -1
- package/dist/{passkey-config-De0ahnRg.mjs.map → passkey-config-C-SKpc0-.mjs.map} +1 -1
- package/dist/{patterns-BKmjvM7K.mjs → patterns-CiyXeDgr.mjs} +1 -1
- package/dist/{patterns-BKmjvM7K.mjs.map → patterns-CiyXeDgr.mjs.map} +1 -1
- package/dist/{placeholder-BSKwzRe4.d.mts → placeholder-Dop47JMM.d.mts} +1 -1
- package/dist/{placeholder-BSKwzRe4.d.mts.map → placeholder-Dop47JMM.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +21 -2
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-utils.d.mts +18 -16
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugin-utils.mjs +8 -6
- package/dist/plugin-utils.mjs.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +15 -3
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{portable-text-cCa0cGV6.mjs → portable-text-sDj92Kxv.mjs} +1 -1
- package/dist/{portable-text-cCa0cGV6.mjs.map → portable-text-sDj92Kxv.mjs.map} +1 -1
- package/dist/{preview-SSXNVPAC.mjs → preview-D4Jnbfx7.mjs} +2 -2
- package/dist/{preview-SSXNVPAC.mjs.map → preview-D4Jnbfx7.mjs.map} +1 -1
- package/dist/{public-url-Danv47cS.mjs → public-url-DSGTnJFw.mjs} +5 -3
- package/dist/public-url-DSGTnJFw.mjs.map +1 -0
- package/dist/{query-1Cp6U9oo.mjs → query-DR73ZNfm.mjs} +15 -15
- package/dist/query-DR73ZNfm.mjs.map +1 -0
- package/dist/{schema-CX9cfNkZ.mjs → query-Di7DOmPV.mjs} +5 -10
- package/dist/query-Di7DOmPV.mjs.map +1 -0
- package/dist/{rate-limit-C_Lf63Dd.mjs → rate-limit-CMj83JNW.mjs} +2 -2
- package/dist/{rate-limit-C_Lf63Dd.mjs.map → rate-limit-CMj83JNW.mjs.map} +1 -1
- package/dist/{redirect-CoW3G-0U.mjs → redirect-Botom7X6.mjs} +1 -1
- package/dist/{redirect-CoW3G-0U.mjs.map → redirect-Botom7X6.mjs.map} +1 -1
- package/dist/{redirect-IyfNirgS.mjs → redirect-CgLPYflR.mjs} +11 -5
- package/dist/redirect-CgLPYflR.mjs.map +1 -0
- package/dist/{redirects-Bs1g42Ri.mjs → redirects-B7t9bKsL.mjs} +6 -6
- package/dist/{redirects-Bs1g42Ri.mjs.map → redirects-B7t9bKsL.mjs.map} +1 -1
- package/dist/{redirects-DXEXBAII.mjs → redirects-BBq3n2Rj.mjs} +10 -143
- package/dist/redirects-BBq3n2Rj.mjs.map +1 -0
- package/dist/{registry-B57vp_X9.mjs → registry-FV15nLge.mjs} +99 -10
- package/dist/registry-FV15nLge.mjs.map +1 -0
- package/dist/relation-9M9j_UWo.mjs +334 -0
- package/dist/relation-9M9j_UWo.mjs.map +1 -0
- package/dist/{byline-fields-2Lp5Hbgf.mjs → relations-5_avdrN_.mjs} +60 -4
- package/dist/relations-5_avdrN_.mjs.map +1 -0
- package/dist/relations-BKvO39-9.mjs +397 -0
- package/dist/relations-BKvO39-9.mjs.map +1 -0
- package/dist/{byline-fields-CHE8UStY.d.mts → relations-Bh8jlFsU.d.mts} +486 -31
- package/dist/relations-Bh8jlFsU.d.mts.map +1 -0
- package/dist/{request-cache-KCNHp_RJ.mjs → request-cache-BSUptuJR.mjs} +1 -1
- package/dist/{request-cache-KCNHp_RJ.mjs.map → request-cache-BSUptuJR.mjs.map} +1 -1
- package/dist/{request-meta-DbvXaAvU.mjs → request-meta-DzXYYI-n.mjs} +2 -2
- package/dist/{request-meta-DbvXaAvU.mjs.map → request-meta-DzXYYI-n.mjs.map} +1 -1
- package/dist/{resolve-DR3wqMTy.mjs → resolve-Cd9dzclN.mjs} +1 -1
- package/dist/{resolve-DR3wqMTy.mjs.map → resolve-Cd9dzclN.mjs.map} +1 -1
- package/dist/{runner-DvFWoz8-.d.mts → runner-Dd8m8k9F.d.mts} +8 -2
- package/dist/runner-Dd8m8k9F.d.mts.map +1 -0
- package/dist/{runner-K8XK101B.mjs → runner-DfnZ5eUr.mjs} +355 -204
- package/dist/runner-DfnZ5eUr.mjs.map +1 -0
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +4 -4
- package/dist/schema-BXxlHeAf.mjs +9 -0
- package/dist/schema-BXxlHeAf.mjs.map +1 -0
- package/dist/scopes-Bl4IwHA-.mjs +27 -0
- package/dist/scopes-Bl4IwHA-.mjs.map +1 -0
- package/dist/{search-DZN2HZ-V.mjs → search-Bff-7jFt.mjs} +62 -12
- package/dist/search-Bff-7jFt.mjs.map +1 -0
- package/dist/{secrets-kp760LlD.mjs → secrets-CSwQIl4q.mjs} +4 -4
- package/dist/{secrets-kp760LlD.mjs.map → secrets-CSwQIl4q.mjs.map} +1 -1
- package/dist/{sections-CpF5SaGr.mjs → sections-CwW4s1al.mjs} +3 -3
- package/dist/{sections-CpF5SaGr.mjs.map → sections-CwW4s1al.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +23 -23
- package/dist/seo/index.d.mts +15 -2
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +22 -5
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-DXu2UQnC.mjs → seo-2cmFHZns.mjs} +2 -2
- package/dist/{seo-DXu2UQnC.mjs.map → seo-2cmFHZns.mjs.map} +1 -1
- package/dist/{seo-89-53DDs.mjs → seo-C3GDfT0V.mjs} +1 -1
- package/dist/{seo-89-53DDs.mjs.map → seo-C3GDfT0V.mjs.map} +1 -1
- package/dist/{service-DQmiBMzt.mjs → service-DkGTWGIi.mjs} +3 -3
- package/dist/{service-DQmiBMzt.mjs.map → service-DkGTWGIi.mjs.map} +1 -1
- package/dist/{session-user-Cascbax7.mjs → session-user-DbHqKDKe.mjs} +1 -1
- package/dist/{session-user-Cascbax7.mjs.map → session-user-DbHqKDKe.mjs.map} +1 -1
- package/dist/{settings-rZyHEcNT.mjs → settings-C4s8hFQm.mjs} +3 -3
- package/dist/{settings-rZyHEcNT.mjs.map → settings-C4s8hFQm.mjs.map} +1 -1
- package/dist/{settings-zhmdKyJQ.mjs → settings-CpA4lQFt.mjs} +6 -6
- package/dist/{settings-zhmdKyJQ.mjs.map → settings-CpA4lQFt.mjs.map} +1 -1
- package/dist/{setup-complete-Cb3LRyzy.mjs → setup-complete-CdIlqloh.mjs} +2 -2
- package/dist/{setup-complete-Cb3LRyzy.mjs.map → setup-complete-CdIlqloh.mjs.map} +1 -1
- package/dist/{setup-nonce-Z8x0tHf8.mjs → setup-nonce-DqiIPr-J.mjs} +1 -1
- package/dist/{setup-nonce-Z8x0tHf8.mjs.map → setup-nonce-DqiIPr-J.mjs.map} +1 -1
- package/dist/{single-flight-cache-BG3B_GhN.mjs → single-flight-cache-C2exrGAi.mjs} +2 -2
- package/dist/{single-flight-cache-BG3B_GhN.mjs.map → single-flight-cache-C2exrGAi.mjs.map} +1 -1
- package/dist/{site-url-BBfDTgZB.mjs → site-url-NGJT6NTU.mjs} +2 -2
- package/dist/{site-url-BBfDTgZB.mjs.map → site-url-NGJT6NTU.mjs.map} +1 -1
- package/dist/{slugify-Cce3dTdg.mjs → slugify-C_tqlU4G.mjs} +1 -1
- package/dist/{slugify-Cce3dTdg.mjs.map → slugify-C_tqlU4G.mjs.map} +1 -1
- package/dist/snapshot-BdpUJKD-.mjs +216 -0
- package/dist/snapshot-BdpUJKD-.mjs.map +1 -0
- package/dist/{ssrf-1g7usGBg.mjs → ssrf-CviKqWmq.mjs} +1 -1
- package/dist/{ssrf-1g7usGBg.mjs.map → ssrf-CviKqWmq.mjs.map} +1 -1
- package/dist/state-xxv6ZTMv.mjs +128 -0
- package/dist/state-xxv6ZTMv.mjs.map +1 -0
- package/dist/{status-CqJQX1QN.mjs → status-COfycGIU.mjs} +1 -1
- package/dist/{status-CqJQX1QN.mjs.map → status-COfycGIU.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-Bs13SN-F.mjs → taxonomies-Ce49uIzY.mjs} +13 -9
- package/dist/taxonomies-Ce49uIzY.mjs.map +1 -0
- package/dist/{taxonomies-kH9ABDUF.mjs → taxonomies-DjSKBZpq.mjs} +115 -36
- package/dist/taxonomies-DjSKBZpq.mjs.map +1 -0
- package/dist/{taxonomy-BxGxZZdu.mjs → taxonomy-DfVooU4W.mjs} +60 -13
- package/dist/taxonomy-DfVooU4W.mjs.map +1 -0
- package/dist/{tokens-BGT0TUUo.mjs → tokens-DVltpO2D.mjs} +2 -2
- package/dist/{tokens-BGT0TUUo.mjs.map → tokens-DVltpO2D.mjs.map} +1 -1
- package/dist/{transaction-qfqpPVpu.mjs → transaction-D0FOsb3X.mjs} +1 -1
- package/dist/{transaction-qfqpPVpu.mjs.map → transaction-D0FOsb3X.mjs.map} +1 -1
- package/dist/{transport-DPefPMcz.mjs → transport-CKrlqSpD.mjs} +1 -1
- package/dist/{transport-DPefPMcz.mjs.map → transport-CKrlqSpD.mjs.map} +1 -1
- package/dist/{transport-BMDWHSgZ.d.mts → transport-Vd7VdqHv.d.mts} +1 -1
- package/dist/{transport-BMDWHSgZ.d.mts.map → transport-Vd7VdqHv.d.mts.map} +1 -1
- package/dist/{trusted-proxy-VTPRiX2s.mjs → trusted-proxy-CwjQj0YG.mjs} +1 -1
- package/dist/{trusted-proxy-VTPRiX2s.mjs.map → trusted-proxy-CwjQj0YG.mjs.map} +1 -1
- package/dist/{types-CgvhU-hF.d.mts → types-B4vm81VH.d.mts} +1 -1
- package/dist/{types-CgvhU-hF.d.mts.map → types-B4vm81VH.d.mts.map} +1 -1
- package/dist/{types-ea9sAPck.d.mts → types-B97jg3aW.d.mts} +6 -1
- package/dist/{types-ea9sAPck.d.mts.map → types-B97jg3aW.d.mts.map} +1 -1
- package/dist/{types-Jo3UYd6b.mjs → types-BD40g7zz.mjs} +1 -1
- package/dist/{types-Jo3UYd6b.mjs.map → types-BD40g7zz.mjs.map} +1 -1
- package/dist/{types-DmHk7vAt.d.mts → types-BNfPHfay.d.mts} +1 -1
- package/dist/{types-DmHk7vAt.d.mts.map → types-BNfPHfay.d.mts.map} +1 -1
- package/dist/{types-BcLUUbbR.d.mts → types-BfYUPJdP.d.mts} +11 -3
- package/dist/{types-BcLUUbbR.d.mts.map → types-BfYUPJdP.d.mts.map} +1 -1
- package/dist/{types-CGbYowGQ.d.mts → types-BvB7gDOD.d.mts} +90 -4
- package/dist/types-BvB7gDOD.d.mts.map +1 -0
- package/dist/{types-vgEWF18A.d.mts → types-C7U0HlEr.d.mts} +1 -1
- package/dist/{types-vgEWF18A.d.mts.map → types-C7U0HlEr.d.mts.map} +1 -1
- package/dist/{types-CuW0zWDA.mjs → types-D1iJ3DpO.mjs} +3 -3
- package/dist/{types-CuW0zWDA.mjs.map → types-D1iJ3DpO.mjs.map} +1 -1
- package/dist/{types-_HFLRzTn.d.mts → types-DPKhI5ib.d.mts} +9 -1
- package/dist/types-DPKhI5ib.d.mts.map +1 -0
- package/dist/{types-g_aFIdW0.d.mts → types-Kmaxdarz.d.mts} +1 -1
- package/dist/{types-g_aFIdW0.d.mts.map → types-Kmaxdarz.d.mts.map} +1 -1
- package/dist/{types-ClUkdbWb.d.mts → types-iVeZ5g6N.d.mts} +1 -1
- package/dist/{types-ClUkdbWb.d.mts.map → types-iVeZ5g6N.d.mts.map} +1 -1
- package/dist/{types-tM44hEcf.mjs → types-o7xo7VgH.mjs} +1 -1
- package/dist/{types-tM44hEcf.mjs.map → types-o7xo7VgH.mjs.map} +1 -1
- package/dist/{user-BjAOvU3Z.mjs → user-Bh-L1qo6.mjs} +3 -3
- package/dist/{user-BjAOvU3Z.mjs.map → user-Bh-L1qo6.mjs.map} +1 -1
- package/dist/{utils-BJXElxdw.mjs → utils-BbUgmeZG.mjs} +3 -3
- package/dist/{utils-BJXElxdw.mjs.map → utils-BbUgmeZG.mjs.map} +1 -1
- package/dist/{validate-Z1b86_3B.d.mts → validate-DULfgpJP.d.mts} +5 -5
- package/dist/{validate-Z1b86_3B.d.mts.map → validate-DULfgpJP.d.mts.map} +1 -1
- package/dist/{validate-CWSnKVIJ.mjs → validate-V9nCwq_-.mjs} +3 -3
- package/dist/{validate-CWSnKVIJ.mjs.map → validate-V9nCwq_-.mjs.map} +1 -1
- package/dist/{validation-0l8-RYj4.mjs → validation-BsVUJfsP.mjs} +10 -10
- package/dist/{validation-0l8-RYj4.mjs.map → validation-BsVUJfsP.mjs.map} +1 -1
- package/dist/version-907opKac.mjs +7 -0
- package/dist/{version-qmeO1XZY.mjs.map → version-907opKac.mjs.map} +1 -1
- package/dist/{widgets-hWcIicX8.mjs → widgets-DGv1Z04V.mjs} +4 -4
- package/dist/{widgets-hWcIicX8.mjs.map → widgets-DGv1Z04V.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-0_uxSrmf.d.mts → wxr-taxonomies-B4tMuN5T.d.mts} +1 -1
- package/dist/{wxr-taxonomies-0_uxSrmf.d.mts.map → wxr-taxonomies-B4tMuN5T.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-CNFcsNCr.mjs → wxr-taxonomies-Cs1N6O8z.mjs} +4 -4
- package/dist/{wxr-taxonomies-CNFcsNCr.mjs.map → wxr-taxonomies-Cs1N6O8z.mjs.map} +1 -1
- package/dist/{zod-generator-CacrR-i8.mjs → zod-generator-B5prQ5M4.mjs} +3 -3
- package/dist/{zod-generator-CacrR-i8.mjs.map → zod-generator-B5prQ5M4.mjs.map} +1 -1
- package/package.json +12 -8
- package/src/api/authorize.ts +10 -1
- package/src/api/error.ts +5 -5
- package/src/api/errors.ts +25 -0
- package/src/api/handlers/backup.ts +312 -0
- package/src/api/handlers/content.ts +147 -3
- package/src/api/handlers/dashboard.ts +2 -0
- package/src/api/handlers/device-flow.ts +2 -3
- package/src/api/handlers/index.ts +22 -0
- package/src/api/handlers/marketplace.ts +38 -0
- package/src/api/handlers/media-upload.ts +210 -0
- package/src/api/handlers/media-usage.ts +289 -0
- package/src/api/handlers/oauth-authorization.ts +2 -6
- package/src/api/handlers/plugin-settings.ts +218 -0
- package/src/api/handlers/plugins.ts +41 -0
- package/src/api/handlers/registry.ts +39 -0
- package/src/api/handlers/relations.ts +474 -0
- package/src/api/handlers/snapshot.ts +21 -3
- package/src/api/handlers/taxonomies.ts +26 -4
- package/src/api/handlers/validate-media-fields.ts +1 -1
- package/src/api/openapi/document.ts +72 -5
- package/src/api/parse.ts +2 -16
- package/src/api/public-url.ts +4 -2
- package/src/api/schemas/comments.ts +6 -0
- package/src/api/schemas/common.ts +6 -2
- package/src/api/schemas/content.ts +8 -0
- package/src/api/schemas/index.ts +2 -0
- package/src/api/schemas/media-usage.ts +120 -0
- package/src/api/schemas/media.ts +32 -1
- package/src/api/schemas/relations.ts +109 -0
- package/src/api/schemas/search.ts +1 -0
- package/src/astro/integration/index.ts +39 -0
- package/src/astro/integration/routes.ts +40 -0
- package/src/astro/integration/runtime.ts +30 -0
- package/src/astro/integration/virtual-modules.ts +41 -7
- package/src/astro/integration/vite-config.ts +17 -1
- package/src/astro/middleware/auth.ts +70 -78
- package/src/astro/middleware/csp.ts +5 -2
- package/src/astro/middleware/request-context.ts +162 -20
- package/src/astro/middleware.ts +108 -40
- package/src/astro/public-plugin-api-routes.ts +2 -1
- package/src/astro/routes/PluginRegistry.tsx +5 -2
- package/src/astro/routes/admin.astro +56 -16
- package/src/astro/routes/api/admin/api-tokens/index.ts +2 -2
- package/src/astro/routes/api/admin/bylines/[id]/translations.ts +2 -5
- package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -2
- package/src/astro/routes/api/admin/comments/index.ts +1 -2
- package/src/astro/routes/api/admin/media-usage/repair.ts +24 -0
- package/src/astro/routes/api/admin/plugins/[id]/index.ts +6 -0
- package/src/astro/routes/api/admin/plugins/[id]/mcp.ts +42 -0
- package/src/astro/routes/api/admin/plugins/[id]/settings.ts +80 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +2 -0
- package/src/astro/routes/api/admin/plugins/index.ts +9 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +2 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +2 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +2 -0
- package/src/astro/routes/api/admin/plugins/updates.ts +2 -4
- package/src/astro/routes/api/auth/mode.ts +6 -14
- package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +21 -5
- package/src/astro/routes/api/auth/oauth/[provider].ts +24 -7
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +13 -0
- package/src/astro/routes/api/content/[collection]/[id]/compare.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +2 -3
- package/src/astro/routes/api/content/[collection]/[id]/permanent.ts +2 -3
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/children.ts +95 -0
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/parents.ts +47 -0
- package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +4 -6
- package/src/astro/routes/api/content/[collection]/[id]/translations.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id].ts +3 -4
- package/src/astro/routes/api/content/[collection]/authors.ts +2 -3
- package/src/astro/routes/api/content/[collection]/index.ts +6 -8
- package/src/astro/routes/api/content/[collection]/trash.ts +2 -3
- package/src/astro/routes/api/manifest.ts +2 -9
- package/src/astro/routes/api/mcp.ts +2 -1
- package/src/astro/routes/api/media/[id]/usage.ts +30 -0
- package/src/astro/routes/api/media/[id].ts +17 -6
- package/src/astro/routes/api/media/file/[...key].ts +8 -0
- package/src/astro/routes/api/media.ts +21 -2
- package/src/astro/routes/api/oauth/authorize.ts +2 -6
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +17 -3
- package/src/astro/routes/api/relations/[id]/index.ts +84 -0
- package/src/astro/routes/api/relations/[id]/translations.ts +33 -0
- package/src/astro/routes/api/relations/index.ts +56 -0
- package/src/astro/routes/api/schema/collections/[slug]/fields/[fieldSlug].ts +1 -7
- package/src/astro/routes/api/schema/collections/[slug]/fields/index.ts +1 -2
- package/src/astro/routes/api/search/index.ts +2 -0
- package/src/astro/routes/api/settings/backups/archives/[name].ts +78 -0
- package/src/astro/routes/api/settings/backups/archives/index.ts +33 -0
- package/src/astro/routes/api/settings/backups/export.ts +43 -0
- package/src/astro/routes/api/settings/backups/index.ts +76 -0
- package/src/astro/routes/api/setup/admin-verify.ts +8 -4
- package/src/astro/routes/api/setup/admin.ts +11 -4
- package/src/astro/routes/api/well-known/oauth-authorization-server.ts +4 -1
- package/src/astro/routes/api/well-known/oauth-protected-resource.ts +5 -1
- package/src/astro/types.ts +50 -2
- package/src/auth/api-tokens.ts +1 -0
- package/src/auth/oauth-state-store.ts +3 -0
- package/src/auth/providers/github-admin.tsx +5 -6
- package/src/auth/providers/google-admin.tsx +5 -6
- package/src/auth/scopes.ts +3 -9
- package/src/cli/client-factory.ts +0 -1
- package/src/cli/commands/bundle-utils.ts +50 -1
- package/src/cli/commands/bundle.ts +9 -2
- package/src/cli/commands/export-seed.ts +1 -10
- package/src/cli/commands/media.ts +127 -0
- package/src/client/index.ts +123 -2
- package/src/client/transport.ts +1 -1
- package/src/comments/service.ts +1 -1
- package/src/comments/turnstile.ts +64 -0
- package/src/components/BlockquoteGroup.astro +34 -0
- package/src/components/CommentForm.astro +12 -5
- package/src/components/EmDashHead.astro +31 -9
- package/src/components/InlinePortableTextEditor.tsx +88 -33
- package/src/components/PortableText.astro +7 -1
- package/src/components/index.ts +2 -0
- package/src/components/marks/Link.astro +5 -1
- package/src/components/portable-text-blockquote-group.ts +68 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +32 -1
- package/src/database/dialect-helpers.ts +111 -3
- package/src/database/migrations/039_fix_fts5_triggers.ts +1 -1
- package/src/database/migrations/051_content_taxonomies_denorm.ts +120 -0
- package/src/database/migrations/052_media_usage_read_index.ts +26 -0
- package/src/database/migrations/053_plugin_mcp_tools.ts +21 -0
- package/src/database/migrations/runner.ts +52 -6
- package/src/database/pg-migration-lock.ts +72 -0
- package/src/database/repositories/audit.ts +2 -1
- package/src/database/repositories/comment.ts +1 -1
- package/src/database/repositories/content.ts +270 -37
- package/src/database/repositories/media-usage.ts +250 -1
- package/src/database/repositories/media.ts +1 -1
- package/src/database/repositories/plugin-storage.ts +29 -32
- package/src/database/repositories/redirect.ts +14 -2
- package/src/database/repositories/relation.ts +130 -5
- package/src/database/repositories/taxonomy.ts +66 -8
- package/src/database/repositories/types.ts +8 -0
- package/src/database/types.ts +23 -0
- package/src/db/adapters.ts +9 -0
- package/src/db/postgres.ts +5 -2
- package/src/emdash-runtime.ts +382 -70
- package/src/index.ts +6 -2
- package/src/loader.ts +293 -32
- package/src/mcp/server.ts +251 -8
- package/src/media/image-endpoint.ts +38 -2
- package/src/page/metadata.ts +27 -0
- package/src/plugin-types.ts +19 -0
- package/src/plugin-utils.ts +8 -6
- package/src/plugins/adapt-sandbox-entry.ts +30 -1
- package/src/plugins/context.ts +92 -0
- package/src/plugins/define-plugin.ts +17 -0
- package/src/plugins/index.ts +4 -0
- package/src/plugins/manifest-schema.ts +30 -1
- package/src/plugins/routes.ts +27 -1
- package/src/plugins/sandbox/runner-options.ts +16 -0
- package/src/plugins/sandbox/types.ts +6 -1
- package/src/plugins/state.ts +17 -1
- package/src/plugins/storage-query.ts +67 -33
- package/src/plugins/types.ts +100 -0
- package/src/schema/byline-registry.ts +1 -1
- package/src/schema/registry.ts +141 -5
- package/src/search/fts-manager.ts +34 -0
- package/src/search/match.ts +50 -0
- package/src/search/query.ts +94 -9
- package/src/seed/apply.ts +28 -29
- package/src/seo/hreflang.ts +192 -0
- package/src/seo/index.ts +22 -4
- package/src/storage/types.ts +6 -0
- package/src/taxonomies/index.ts +62 -45
- package/src/taxonomies/term-counts.ts +117 -0
- package/src/utils/base64.ts +7 -2
- package/src/utils/db-errors.ts +3 -1
- package/src/virtual-modules.d.ts +14 -0
- package/src/visual-editing/editable.ts +41 -35
- package/src/visual-editing/toolbar-bootstrap.ts +120 -0
- package/src/visual-editing/toolbar.ts +47 -1
- package/dist/adapters-hUy8vOB-.d.mts.map +0 -1
- package/dist/api-DxFSorgk.mjs.map +0 -1
- package/dist/api-tokens-DsvvCtdh.mjs +0 -3
- package/dist/apply-CDJqIjPU.mjs.map +0 -1
- package/dist/authorize-Dz88F_Fw.mjs.map +0 -1
- package/dist/base64-CmWvODNW.mjs.map +0 -1
- package/dist/byline-fields-2Lp5Hbgf.mjs.map +0 -1
- package/dist/byline-fields-CHE8UStY.d.mts.map +0 -1
- package/dist/content-DhgEth4k.mjs.map +0 -1
- package/dist/content-refresh-Br4gMzh8.mjs.map +0 -1
- package/dist/context-BRIpHARC.mjs.map +0 -1
- package/dist/dashboard-EvEKF5en.mjs.map +0 -1
- package/dist/db-errors-CK46D-ly.mjs.map +0 -1
- package/dist/device-flow-CfGP18Uw.mjs.map +0 -1
- package/dist/dialect-helpers-DRI5pyY3.mjs +0 -110
- package/dist/dialect-helpers-DRI5pyY3.mjs.map +0 -1
- package/dist/error-CkAseSqZ.mjs.map +0 -1
- package/dist/index-B9sIxwe4.d.mts.map +0 -1
- package/dist/loader-CB6YHeul.mjs.map +0 -1
- package/dist/manifest-schema-BHlgZM1W.mjs.map +0 -1
- package/dist/media-BrXIaMFN.mjs.map +0 -1
- package/dist/menus-b2T4clbO.mjs.map +0 -1
- package/dist/oauth-authorization-CXWkIGT4.mjs.map +0 -1
- package/dist/public-url-Danv47cS.mjs.map +0 -1
- package/dist/query-1Cp6U9oo.mjs.map +0 -1
- package/dist/redirect-IyfNirgS.mjs.map +0 -1
- package/dist/redirects-DXEXBAII.mjs.map +0 -1
- package/dist/registry-B57vp_X9.mjs.map +0 -1
- package/dist/runner-DvFWoz8-.d.mts.map +0 -1
- package/dist/runner-K8XK101B.mjs.map +0 -1
- package/dist/scheduled-publish-Drffrf2a.d.mts +0 -11
- package/dist/scheduled-publish-Drffrf2a.d.mts.map +0 -1
- package/dist/schema-CX9cfNkZ.mjs.map +0 -1
- package/dist/search-DZN2HZ-V.mjs.map +0 -1
- package/dist/taxonomies-Bs13SN-F.mjs.map +0 -1
- package/dist/taxonomies-kH9ABDUF.mjs.map +0 -1
- package/dist/taxonomy-BxGxZZdu.mjs.map +0 -1
- package/dist/types-CGbYowGQ.d.mts.map +0 -1
- package/dist/types-_HFLRzTn.d.mts.map +0 -1
- package/dist/version-qmeO1XZY.mjs +0 -7
- /package/dist/{ssrf-CmuGgCq3.mjs → ssrf-BB__xfNM.mjs} +0 -0
- /package/dist/{types-DROWRxYV.mjs → types-CK0LxPUQ.mjs} +0 -0
|
@@ -1,80 +1,90 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as runMigrations, n as MIGRATION_RACE_WAIT_MS, t as ConcurrentMigrationTimeoutError } from "../runner-DfnZ5eUr.mjs";
|
|
2
2
|
import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { s as isSqlite } from "../dialect-helpers-HxEQGl_1.mjs";
|
|
4
4
|
import { i as setI18nConfig } from "../config-CVssduLe.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { E as AuditRepository, _ as createHookPipeline, h as EmailPipeline, m as buildRouteMeta, p as PluginRouteRegistry, t as getMenu, v as resolveExclusiveHooks, y as definePlugin } from "../menus-BcyElFtI.mjs";
|
|
6
6
|
import { t as after } from "../after-B1IIdH3Y.mjs";
|
|
7
7
|
import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
|
|
8
8
|
import "../object-cache-Bok5j2ae.mjs";
|
|
9
|
-
import { r as RevisionRepository, t as ContentRepository } from "../content-
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import
|
|
13
|
-
import "../
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import
|
|
21
|
-
import "../
|
|
22
|
-
import
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import
|
|
26
|
-
import "../
|
|
27
|
-
import "../
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import "../
|
|
31
|
-
import
|
|
32
|
-
import { i as markContentMediaUsageCollectionStale, o as refreshContentMediaUsageAfterWrite, r as findNonTranslatableSiblingContentIds, t as deleteContentMediaUsage } from "../content-refresh-Br4gMzh8.mjs";
|
|
33
|
-
import { t as FTSManager } from "../fts-manager-BbFaF_V8.mjs";
|
|
34
|
-
import { n as SchemaRegistry } from "../registry-B57vp_X9.mjs";
|
|
9
|
+
import { r as RevisionRepository, t as ContentRepository } from "../content-Ci04z2z-.mjs";
|
|
10
|
+
import { n as isMissingTableError } from "../db-errors-CcWLaRiR.mjs";
|
|
11
|
+
import "../base64-B-PsqheR.mjs";
|
|
12
|
+
import "../types-D1iJ3DpO.mjs";
|
|
13
|
+
import { t as MediaRepository } from "../media-BjhhENaJ.mjs";
|
|
14
|
+
import "../user-Bh-L1qo6.mjs";
|
|
15
|
+
import "../taxonomy-DfVooU4W.mjs";
|
|
16
|
+
import "../comment-DPT0WKyd.mjs";
|
|
17
|
+
import { t as OptionsRepository } from "../options-BlmBHTvX.mjs";
|
|
18
|
+
import { r as createSiteInfo } from "../context-B6hc7zJL.mjs";
|
|
19
|
+
import "../menus-CZyG6rvx.mjs";
|
|
20
|
+
import "../redirect-CgLPYflR.mjs";
|
|
21
|
+
import { i as setRequestCacheEntry, r as requestCached } from "../request-cache-BSUptuJR.mjs";
|
|
22
|
+
import "../byline-registry-BCuOp4UF.mjs";
|
|
23
|
+
import { n as initWithLock, t as createInitLock } from "../init-lock-DJkX6Hto.mjs";
|
|
24
|
+
import "../field-defs-cache-DvmlgP-D.mjs";
|
|
25
|
+
import "../byline-XEjchwzZ.mjs";
|
|
26
|
+
import "../relation-9M9j_UWo.mjs";
|
|
27
|
+
import { n as normalizeMediaValue } from "../normalize-C-SHXmra.mjs";
|
|
28
|
+
import "../enrich-CFJJgxs_.mjs";
|
|
29
|
+
import "../seo-2cmFHZns.mjs";
|
|
30
|
+
import { t as FTSManager } from "../fts-manager-DzqIBrrW.mjs";
|
|
31
|
+
import "../resolve-Cd9dzclN.mjs";
|
|
35
32
|
import { createRecorder, flushRecorder, isInstrumentationEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
36
|
-
import { a as getDb } from "../loader-
|
|
37
|
-
import "../
|
|
38
|
-
import "../
|
|
39
|
-
import "../
|
|
40
|
-
import "../
|
|
41
|
-
import {
|
|
42
|
-
import
|
|
43
|
-
import "../
|
|
44
|
-
import "../
|
|
45
|
-
import
|
|
46
|
-
import "../
|
|
47
|
-
import
|
|
48
|
-
import "../
|
|
49
|
-
import "../
|
|
50
|
-
import "../
|
|
51
|
-
import "../
|
|
52
|
-
import "../
|
|
53
|
-
import "../
|
|
54
|
-
import "../
|
|
55
|
-
import
|
|
56
|
-
import "../
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import "../
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import "../
|
|
63
|
-
import "../
|
|
64
|
-
import "../
|
|
65
|
-
import "../
|
|
66
|
-
import "../
|
|
67
|
-
import
|
|
68
|
-
import "../
|
|
69
|
-
import "../
|
|
70
|
-
import "../
|
|
33
|
+
import { a as getDb } from "../loader-Be3ouI5L.mjs";
|
|
34
|
+
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-DjSKBZpq.mjs";
|
|
35
|
+
import { $ as handleContentDiscardDraft, B as handleMediaGet, G as handleRevisionRestore, H as handleMediaUpdate, J as handleContentCompare, Q as handleContentDelete, R as handleMediaCreate, U as handleRevisionGet, V as handleMediaList, W as handleRevisionList, X as handleContentCountTrashed, Y as handleContentCountScheduled, Z as handleContentCreate, _ as loadBundleFromR2, at as handleContentPermanentDelete, ct as handleContentSchedule, dt as handleContentUnschedule, et as handleContentDuplicate, ft as handleContentUpdate, it as handleContentListTrashed, lt as handleContentTranslations, nt as handleContentGetIncludingTrashed, ot as handleContentPublish, pt as validateRev, q as handleContentAuthors, rt as handleContentList, s as normalizeRegistryConfig, st as handleContentRestore, tt as handleContentGet, ut as handleContentUnpublish, z as handleMediaDelete } from "../api-b8WIiGU4.mjs";
|
|
36
|
+
import "../dashboard-C5NkXFbi.mjs";
|
|
37
|
+
import { n as hashString } from "../hash-DFFrkivP.mjs";
|
|
38
|
+
import { a as findNonTranslatableSiblingContentIds, c as refreshContentMediaUsageAfterWrite, o as markContentMediaUsageCollectionStale, r as deleteContentMediaUsage } from "../content-refresh-D4khvC0R.mjs";
|
|
39
|
+
import "../media-usage-CljdO1mc.mjs";
|
|
40
|
+
import { n as SchemaRegistry } from "../registry-FV15nLge.mjs";
|
|
41
|
+
import "../query-Di7DOmPV.mjs";
|
|
42
|
+
import "../zod-generator-B5prQ5M4.mjs";
|
|
43
|
+
import "../schema-BXxlHeAf.mjs";
|
|
44
|
+
import "../seo-C3GDfT0V.mjs";
|
|
45
|
+
import { t as PluginStateRepository } from "../state-xxv6ZTMv.mjs";
|
|
46
|
+
import "../sections-CwW4s1al.mjs";
|
|
47
|
+
import { r as singleFlightCached, t as createSingleFlightCache } from "../single-flight-cache-C2exrGAi.mjs";
|
|
48
|
+
import { i as getSiteSettings, o as invalidateSiteSettingsCache } from "../settings-CpA4lQFt.mjs";
|
|
49
|
+
import "../settings-C4s8hFQm.mjs";
|
|
50
|
+
import "../taxonomies-Ce49uIzY.mjs";
|
|
51
|
+
import { r as normalizeManifestRoute } from "../manifest-schema-bCq54i7F.mjs";
|
|
52
|
+
import "../types-CK0LxPUQ.mjs";
|
|
53
|
+
import "../ssrf-CviKqWmq.mjs";
|
|
54
|
+
import "../error-CEGF6UZb.mjs";
|
|
55
|
+
import "../parse-C_-6klII.mjs";
|
|
56
|
+
import "../media-kIV1IxFf.mjs";
|
|
57
|
+
import "../redirects-BBq3n2Rj.mjs";
|
|
58
|
+
import "../relations-5_avdrN_.mjs";
|
|
59
|
+
import "../status-COfycGIU.mjs";
|
|
60
|
+
import { a as invalidateUrlPatternCache } from "../query-DR73ZNfm.mjs";
|
|
61
|
+
import "../import-Dmkm8S1W.mjs";
|
|
62
|
+
import { t as getTrustedProxyHeaders } from "../trusted-proxy-CwjQj0YG.mjs";
|
|
63
|
+
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-DzXYYI-n.mjs";
|
|
64
|
+
import "../ssrf-BB__xfNM.mjs";
|
|
65
|
+
import { n as CronExecutor } from "../cron-BlKIMD_e.mjs";
|
|
66
|
+
import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-C-9Ng8DM.mjs";
|
|
67
|
+
import "../utils-BbUgmeZG.mjs";
|
|
68
|
+
import "../tokens-DVltpO2D.mjs";
|
|
69
|
+
import "../preview-D4Jnbfx7.mjs";
|
|
70
|
+
import "../hreflang-db2Tpb2o.mjs";
|
|
71
|
+
import "../comment-reaction-C65MldIB.mjs";
|
|
72
|
+
import "../bylines-czseViYo.mjs";
|
|
73
|
+
import { n as getWidgetAreas } from "../widgets-DGv1Z04V.mjs";
|
|
74
|
+
import "../apply-CmIJK9j8.mjs";
|
|
75
|
+
import "../load-Cx27ki1l.mjs";
|
|
76
|
+
import "../search-Bff-7jFt.mjs";
|
|
71
77
|
import "../index.mjs";
|
|
72
|
-
import { n as VERSION, t as COMMIT } from "../version-
|
|
73
|
-
import { t as getAuthMode } from "../mode-
|
|
74
|
-
import
|
|
75
|
-
import {
|
|
76
|
-
import { t as
|
|
78
|
+
import { n as VERSION, t as COMMIT } from "../version-907opKac.mjs";
|
|
79
|
+
import { t as getAuthMode } from "../mode-fiXRMfeA.mjs";
|
|
80
|
+
import "../snapshot-BdpUJKD-.mjs";
|
|
81
|
+
import { u as maybeRunScheduledBackup } from "../backup-S8kFWtwD.mjs";
|
|
82
|
+
import { t as cleanupExpiredChallenges } from "../challenge-store-BFzgFRog.mjs";
|
|
83
|
+
import { a as validateEncryptionKeyAtStartup } from "../secrets-CSwQIl4q.mjs";
|
|
84
|
+
import { t as resolveSessionUser } from "../session-user-DbHqKDKe.mjs";
|
|
77
85
|
import { Kysely, sql } from "kysely";
|
|
86
|
+
import { z } from "zod";
|
|
87
|
+
import { Permissions } from "@emdash-cms/auth";
|
|
78
88
|
import { defineMiddleware } from "astro:middleware";
|
|
79
89
|
import virtualConfig from "virtual:emdash/config";
|
|
80
90
|
import { createCoalescingDialect, createDialect, createRequestScopedDb } from "virtual:emdash/dialect";
|
|
@@ -86,6 +96,19 @@ import { createScheduler } from "virtual:emdash/scheduler";
|
|
|
86
96
|
import { createStorage } from "virtual:emdash/storage";
|
|
87
97
|
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
|
|
88
98
|
|
|
99
|
+
//#region src/plugins/sandbox/runner-options.ts
|
|
100
|
+
/**
|
|
101
|
+
* Build platform sandbox options with the same normalized site context used
|
|
102
|
+
* by trusted plugin hooks and routes.
|
|
103
|
+
*/
|
|
104
|
+
function createSandboxRunnerOptions(options, siteInfo) {
|
|
105
|
+
return {
|
|
106
|
+
...options,
|
|
107
|
+
siteInfo: createSiteInfo(siteInfo ?? {})
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
//#endregion
|
|
89
112
|
//#region src/cleanup.ts
|
|
90
113
|
/**
|
|
91
114
|
* System cleanup
|
|
@@ -272,6 +295,14 @@ async function publishDueContent(db, options = {}) {
|
|
|
272
295
|
|
|
273
296
|
//#endregion
|
|
274
297
|
//#region src/emdash-runtime.ts
|
|
298
|
+
/**
|
|
299
|
+
* EmDashRuntime - Core runtime for EmDash CMS
|
|
300
|
+
*
|
|
301
|
+
* Manages database, storage, plugins (trusted + sandboxed), hooks, and
|
|
302
|
+
* provides handlers for content/media operations.
|
|
303
|
+
*
|
|
304
|
+
* Created once per worker lifetime, cached and reused across requests.
|
|
305
|
+
*/
|
|
275
306
|
const LEADING_SLASH_PATTERN = /^\//;
|
|
276
307
|
/**
|
|
277
308
|
* Parse a JSON column expected to contain an array of strings.
|
|
@@ -369,13 +400,22 @@ function getDbHolder() {
|
|
|
369
400
|
if (!holder) {
|
|
370
401
|
holder = {
|
|
371
402
|
cache: /* @__PURE__ */ new Map(),
|
|
372
|
-
lock: createInitLock()
|
|
403
|
+
lock: createInitLock(),
|
|
404
|
+
failures: /* @__PURE__ */ new Map()
|
|
373
405
|
};
|
|
374
406
|
globalSymbolStore[DB_HOLDER_KEY] = holder;
|
|
375
407
|
}
|
|
408
|
+
holder.failures ??= /* @__PURE__ */ new Map();
|
|
376
409
|
return holder;
|
|
377
410
|
}
|
|
378
411
|
/**
|
|
412
|
+
* After a database init fails (migrations threw), skip re-attempting for
|
|
413
|
+
* this long. Cold isolates still get one attempt each, so a transient
|
|
414
|
+
* failure heals on its own; a persistently failing migration is retried at
|
|
415
|
+
* most once per backoff window per isolate instead of on every request.
|
|
416
|
+
*/
|
|
417
|
+
const DB_INIT_FAILURE_BACKOFF_MS = 3e4;
|
|
418
|
+
/**
|
|
379
419
|
* Auto-seed runs at most once per isolate per database. Its lock + "done" set
|
|
380
420
|
* live on globalThis (same bundler-duplication reasoning as the db cache) so a
|
|
381
421
|
* reclaimed-and-rerun `create()` can't seed a second time concurrently. The
|
|
@@ -565,6 +605,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
565
605
|
} catch (error) {
|
|
566
606
|
console.error("[cleanup] System cleanup failed:", error);
|
|
567
607
|
}
|
|
608
|
+
await maybeRunScheduledBackup(this.db, this.storage ?? void 0);
|
|
568
609
|
return { published };
|
|
569
610
|
}
|
|
570
611
|
/**
|
|
@@ -605,10 +646,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
605
646
|
const newPipeline = createHookPipeline(this.allPipelinePlugins.filter((p) => this.enabledPlugins.has(p.id)), this.pipelineFactoryOptions);
|
|
606
647
|
await EmDashRuntime.resolveExclusiveHooks(newPipeline, this.db, this.runtimeDeps);
|
|
607
648
|
if (this.email) newPipeline.setContextFactory({ emailPipeline: this.email });
|
|
608
|
-
|
|
609
|
-
const scheduler = this.cronScheduler;
|
|
610
|
-
newPipeline.setContextFactory({ cronReschedule: () => scheduler.reschedule() });
|
|
611
|
-
}
|
|
649
|
+
newPipeline.setContextFactory({ cronReschedule: () => this.cronScheduler?.reschedule() });
|
|
612
650
|
if (this.email) this.email.setPipeline(newPipeline);
|
|
613
651
|
this.pipelineRef.current = newPipeline;
|
|
614
652
|
this._hooks = newPipeline;
|
|
@@ -710,13 +748,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
710
748
|
marketplaceManifestCache.set(pluginId, {
|
|
711
749
|
id: bundle.manifest.id,
|
|
712
750
|
version: bundle.manifest.version,
|
|
713
|
-
admin: bundle.manifest.admin
|
|
751
|
+
admin: bundle.manifest.admin,
|
|
752
|
+
mcp: bundle.manifest.mcp
|
|
714
753
|
});
|
|
715
754
|
if (bundle.manifest.routes.length > 0) {
|
|
716
755
|
const routeMetaMap = /* @__PURE__ */ new Map();
|
|
717
756
|
for (const entry of bundle.manifest.routes) {
|
|
718
757
|
const normalized = normalizeManifestRoute(entry);
|
|
719
|
-
routeMetaMap.set(normalized.name,
|
|
758
|
+
routeMetaMap.set(normalized.name, buildRouteMeta(normalized));
|
|
720
759
|
}
|
|
721
760
|
sandboxedRouteMetaCache.set(pluginId, routeMetaMap);
|
|
722
761
|
} else sandboxedRouteMetaCache.delete(pluginId);
|
|
@@ -794,13 +833,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
794
833
|
marketplaceManifestCache.set(pluginId, {
|
|
795
834
|
id: bundle.manifest.id,
|
|
796
835
|
version: bundle.manifest.version,
|
|
797
|
-
admin: bundle.manifest.admin
|
|
836
|
+
admin: bundle.manifest.admin,
|
|
837
|
+
mcp: bundle.manifest.mcp
|
|
798
838
|
});
|
|
799
839
|
if (bundle.manifest.routes.length > 0) {
|
|
800
840
|
const routeMetaMap = /* @__PURE__ */ new Map();
|
|
801
841
|
for (const entry of bundle.manifest.routes) {
|
|
802
842
|
const normalized = normalizeManifestRoute(entry);
|
|
803
|
-
routeMetaMap.set(normalized.name,
|
|
843
|
+
routeMetaMap.set(normalized.name, buildRouteMeta(normalized));
|
|
804
844
|
}
|
|
805
845
|
sandboxedRouteMetaCache.set(pluginId, routeMetaMap);
|
|
806
846
|
} else sandboxedRouteMetaCache.delete(pluginId);
|
|
@@ -821,7 +861,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
821
861
|
id: w.id,
|
|
822
862
|
title: w.title,
|
|
823
863
|
size: w.size === "full" || w.size === "half" || w.size === "third" ? w.size : void 0
|
|
824
|
-
}))
|
|
864
|
+
})),
|
|
865
|
+
settingsSchema: bundle.manifest.admin?.settingsSchema
|
|
825
866
|
});
|
|
826
867
|
newPlugins.push(adapted);
|
|
827
868
|
this.allPipelinePlugins.push(adapted);
|
|
@@ -891,7 +932,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
891
932
|
return {
|
|
892
933
|
siteName: siteOpts.get("emdash:site_title") ?? void 0,
|
|
893
934
|
siteUrl: siteOpts.get("emdash:site_url") ?? void 0,
|
|
894
|
-
locale: siteOpts.get("emdash:locale") ?? void 0
|
|
935
|
+
locale: siteOpts.get("emdash:locale") ?? void 0,
|
|
936
|
+
trailingSlash: virtualConfig?.trailingSlash
|
|
895
937
|
};
|
|
896
938
|
};
|
|
897
939
|
const coldStartReads = [phase("rt.plugins", "Plugin states", async () => {
|
|
@@ -926,9 +968,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
926
968
|
const seedHolder = getSeedHolder();
|
|
927
969
|
try {
|
|
928
970
|
await initWithLock(seedHolder.lock, () => seedHolder.done.has(seedKey) ? true : void 0, async () => {
|
|
929
|
-
const { applySeed } = await import("../apply-
|
|
930
|
-
const { loadSeed } = await import("../load-
|
|
931
|
-
const { validateSeed } = await import("../validate-
|
|
971
|
+
const { applySeed } = await import("../apply-CmIJK9j8.mjs").then((n) => n.n);
|
|
972
|
+
const { loadSeed } = await import("../load-Cx27ki1l.mjs").then((n) => n.r);
|
|
973
|
+
const { validateSeed } = await import("../validate-V9nCwq_-.mjs").then((n) => n.n);
|
|
932
974
|
const seed = await loadSeed();
|
|
933
975
|
if (validateSeed(seed).valid) {
|
|
934
976
|
await applySeed(db, seed, { onConflict: "skip" });
|
|
@@ -1013,10 +1055,10 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1013
1055
|
siteInfo
|
|
1014
1056
|
};
|
|
1015
1057
|
const pipeline = createHookPipeline(enabledPluginList, pipelineFactoryOptions);
|
|
1016
|
-
const sandboxedPlugins = await phase("rt.sandbox", "Sandboxed plugins", () => EmDashRuntime.loadSandboxedPlugins(deps, db, storage));
|
|
1058
|
+
const sandboxedPlugins = await phase("rt.sandbox", "Sandboxed plugins", () => EmDashRuntime.loadSandboxedPlugins(deps, db, storage, siteInfo));
|
|
1017
1059
|
const installedTierPhases = [];
|
|
1018
|
-
if (deps.config.marketplace && storage && !deps.sandboxBypassed) installedTierPhases.push(phase("rt.market", "Marketplace plugins", () => EmDashRuntime.loadInstalledSandboxedPlugins("marketplace", db, storage, deps, sandboxedPlugins)));
|
|
1019
|
-
if (deps.config.experimental?.registry && storage) installedTierPhases.push(phase("rt.registry", "Registry plugins", () => EmDashRuntime.loadInstalledSandboxedPlugins("registry", db, storage, deps, sandboxedPlugins)));
|
|
1060
|
+
if (deps.config.marketplace && storage && !deps.sandboxBypassed) installedTierPhases.push(phase("rt.market", "Marketplace plugins", () => EmDashRuntime.loadInstalledSandboxedPlugins("marketplace", db, storage, deps, sandboxedPlugins, siteInfo)));
|
|
1061
|
+
if (deps.config.experimental?.registry && storage) installedTierPhases.push(phase("rt.registry", "Registry plugins", () => EmDashRuntime.loadInstalledSandboxedPlugins("registry", db, storage, deps, sandboxedPlugins, siteInfo)));
|
|
1020
1062
|
if (installedTierPhases.length > 0) await Promise.all(installedTierPhases);
|
|
1021
1063
|
const mediaProviders = /* @__PURE__ */ new Map();
|
|
1022
1064
|
const mediaProviderEntries = deps.mediaProviderEntries ?? [];
|
|
@@ -1046,6 +1088,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1046
1088
|
await phase("rt.cron", "Cron init (recovery deferred post-response)", async () => {
|
|
1047
1089
|
try {
|
|
1048
1090
|
cronExecutor = new CronExecutor(resolveDb, invokeCronHook);
|
|
1091
|
+
pipeline.setContextFactory({ cronReschedule: () => cronScheduler?.reschedule() });
|
|
1049
1092
|
const executorForRecovery = cronExecutor;
|
|
1050
1093
|
after(async () => {
|
|
1051
1094
|
try {
|
|
@@ -1070,8 +1113,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1070
1113
|
} catch (error) {
|
|
1071
1114
|
console.error("[cleanup] System cleanup failed:", error);
|
|
1072
1115
|
}
|
|
1116
|
+
await maybeRunScheduledBackup(db, storage ?? void 0);
|
|
1073
1117
|
});
|
|
1074
|
-
pipeline.setContextFactory({ cronReschedule: () => cronScheduler?.reschedule() });
|
|
1075
1118
|
scheduler.start();
|
|
1076
1119
|
}
|
|
1077
1120
|
} catch (error) {
|
|
@@ -1132,12 +1175,30 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1132
1175
|
}
|
|
1133
1176
|
const cacheKey = dbConfig.entrypoint;
|
|
1134
1177
|
const holder = getDbHolder();
|
|
1178
|
+
const throwIfBackingOff = () => {
|
|
1179
|
+
const failure = holder.failures.get(cacheKey);
|
|
1180
|
+
if (!failure) return;
|
|
1181
|
+
if (Date.now() - failure.at < DB_INIT_FAILURE_BACKOFF_MS) throw new Error(`Database initialization is backing off after a recent migration failure: ${failure.message}`);
|
|
1182
|
+
holder.failures.delete(cacheKey);
|
|
1183
|
+
};
|
|
1184
|
+
throwIfBackingOff();
|
|
1135
1185
|
return initWithLock(holder.lock, () => holder.cache.get(cacheKey), async (isCurrentClaim) => {
|
|
1186
|
+
throwIfBackingOff();
|
|
1136
1187
|
const db = new Kysely({
|
|
1137
1188
|
dialect: deps.createDialect(dbConfig.config),
|
|
1138
1189
|
log: kyselyLogOption()
|
|
1139
1190
|
});
|
|
1140
|
-
|
|
1191
|
+
try {
|
|
1192
|
+
await runMigrations(db);
|
|
1193
|
+
} catch (error) {
|
|
1194
|
+
if (!(error instanceof ConcurrentMigrationTimeoutError)) holder.failures.set(cacheKey, {
|
|
1195
|
+
at: Date.now(),
|
|
1196
|
+
message: error instanceof Error ? error.message : String(error)
|
|
1197
|
+
});
|
|
1198
|
+
await db.destroy().catch(() => {});
|
|
1199
|
+
throw error;
|
|
1200
|
+
}
|
|
1201
|
+
holder.failures.delete(cacheKey);
|
|
1141
1202
|
if (isCurrentClaim()) holder.cache.set(cacheKey, db);
|
|
1142
1203
|
return db;
|
|
1143
1204
|
}, {
|
|
@@ -1194,6 +1255,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1194
1255
|
storage: entry.storage,
|
|
1195
1256
|
adminPages,
|
|
1196
1257
|
adminWidgets,
|
|
1258
|
+
settingsSchema: entry.settingsSchema,
|
|
1197
1259
|
portableTextBlocks: entry.portableTextBlocks,
|
|
1198
1260
|
fieldWidgets: entry.fieldWidgets
|
|
1199
1261
|
});
|
|
@@ -1207,10 +1269,10 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1207
1269
|
/**
|
|
1208
1270
|
* Load sandboxed plugins using SandboxRunner
|
|
1209
1271
|
*/
|
|
1210
|
-
static async loadSandboxedPlugins(deps, db, mediaStorage) {
|
|
1272
|
+
static async loadSandboxedPlugins(deps, db, mediaStorage, siteInfo) {
|
|
1211
1273
|
if (sandboxedPluginCache.size > 0) return sandboxedPluginCache;
|
|
1212
1274
|
if (!deps.sandboxEnabled) return sandboxedPluginCache;
|
|
1213
|
-
if (!sandboxRunner && deps.createSandboxRunner) sandboxRunner = deps.createSandboxRunner({
|
|
1275
|
+
if (!sandboxRunner && deps.createSandboxRunner) sandboxRunner = deps.createSandboxRunner(createSandboxRunnerOptions({
|
|
1214
1276
|
db,
|
|
1215
1277
|
mediaStorage: mediaStorage ? {
|
|
1216
1278
|
upload: (opts) => mediaStorage.upload({
|
|
@@ -1220,7 +1282,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1220
1282
|
}),
|
|
1221
1283
|
delete: (key) => mediaStorage.delete(key)
|
|
1222
1284
|
} : void 0
|
|
1223
|
-
});
|
|
1285
|
+
}, siteInfo));
|
|
1224
1286
|
if (!sandboxRunner) return sandboxedPluginCache;
|
|
1225
1287
|
if (!sandboxRunner.isAvailable()) {
|
|
1226
1288
|
console.warn("EmDash: Plugin sandbox is configured but not available on this platform. Sandboxed plugins will not be loaded. If using @emdash-cms/sandbox-workerd/sandbox, ensure workerd is installed.");
|
|
@@ -1240,7 +1302,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1240
1302
|
storage: entry.storage ?? {},
|
|
1241
1303
|
hooks: [],
|
|
1242
1304
|
routes: [],
|
|
1243
|
-
admin: {}
|
|
1305
|
+
admin: {},
|
|
1306
|
+
mcp: entry.mcp
|
|
1244
1307
|
};
|
|
1245
1308
|
const plugin = await sandboxRunner.load(manifest, entry.code);
|
|
1246
1309
|
sandboxedPluginCache.set(pluginKey, plugin);
|
|
@@ -1265,8 +1328,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1265
1328
|
* creation, before request traffic arrives; the sync method runs on
|
|
1266
1329
|
* demand after install / update / uninstall handlers.
|
|
1267
1330
|
*/
|
|
1268
|
-
static async loadInstalledSandboxedPlugins(source, db, storage, deps, cache) {
|
|
1269
|
-
if (!sandboxRunner && deps.createSandboxRunner) sandboxRunner = deps.createSandboxRunner({
|
|
1331
|
+
static async loadInstalledSandboxedPlugins(source, db, storage, deps, cache, siteInfo) {
|
|
1332
|
+
if (!sandboxRunner && deps.createSandboxRunner) sandboxRunner = deps.createSandboxRunner(createSandboxRunnerOptions({
|
|
1270
1333
|
db,
|
|
1271
1334
|
mediaStorage: {
|
|
1272
1335
|
upload: (opts) => storage.upload({
|
|
@@ -1276,7 +1339,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1276
1339
|
}),
|
|
1277
1340
|
delete: (key) => storage.delete(key)
|
|
1278
1341
|
}
|
|
1279
|
-
});
|
|
1342
|
+
}, siteInfo));
|
|
1280
1343
|
if (deps.sandboxBypassed) return;
|
|
1281
1344
|
if (!sandboxRunner || !sandboxRunner.isAvailable()) return;
|
|
1282
1345
|
const keySet = source === "marketplace" ? marketplacePluginKeys : registryPluginKeys;
|
|
@@ -1300,13 +1363,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1300
1363
|
marketplaceManifestCache.set(plugin.pluginId, {
|
|
1301
1364
|
id: bundle.manifest.id,
|
|
1302
1365
|
version: bundle.manifest.version,
|
|
1303
|
-
admin: bundle.manifest.admin
|
|
1366
|
+
admin: bundle.manifest.admin,
|
|
1367
|
+
mcp: bundle.manifest.mcp
|
|
1304
1368
|
});
|
|
1305
1369
|
if (bundle.manifest.routes.length > 0) {
|
|
1306
1370
|
const routeMeta = /* @__PURE__ */ new Map();
|
|
1307
1371
|
for (const entry of bundle.manifest.routes) {
|
|
1308
1372
|
const normalized = normalizeManifestRoute(entry);
|
|
1309
|
-
routeMeta.set(normalized.name,
|
|
1373
|
+
routeMeta.set(normalized.name, buildRouteMeta(normalized));
|
|
1310
1374
|
}
|
|
1311
1375
|
sandboxedRouteMetaCache.set(plugin.pluginId, routeMeta);
|
|
1312
1376
|
}
|
|
@@ -1349,13 +1413,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1349
1413
|
marketplaceManifestCache.set(plugin.pluginId, {
|
|
1350
1414
|
id: bundle.manifest.id,
|
|
1351
1415
|
version: bundle.manifest.version,
|
|
1352
|
-
admin: bundle.manifest.admin
|
|
1416
|
+
admin: bundle.manifest.admin,
|
|
1417
|
+
mcp: bundle.manifest.mcp
|
|
1353
1418
|
});
|
|
1354
1419
|
if (bundle.manifest.routes.length > 0) {
|
|
1355
1420
|
const routeMeta = /* @__PURE__ */ new Map();
|
|
1356
1421
|
for (const entry of bundle.manifest.routes) {
|
|
1357
1422
|
const normalized = normalizeManifestRoute(entry);
|
|
1358
|
-
routeMeta.set(normalized.name,
|
|
1423
|
+
routeMeta.set(normalized.name, buildRouteMeta(normalized));
|
|
1359
1424
|
}
|
|
1360
1425
|
sandboxedRouteMetaCache.set(plugin.pluginId, routeMeta);
|
|
1361
1426
|
}
|
|
@@ -1372,7 +1437,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1372
1437
|
id: w.id,
|
|
1373
1438
|
title: w.title,
|
|
1374
1439
|
size: w.size === "full" || w.size === "half" || w.size === "third" ? w.size : void 0
|
|
1375
|
-
}))
|
|
1440
|
+
})),
|
|
1441
|
+
settingsSchema: bundle.manifest.admin?.settingsSchema
|
|
1376
1442
|
});
|
|
1377
1443
|
resolved.push(adapted);
|
|
1378
1444
|
console.log(`EmDash: Loaded marketplace plugin ${plugin.pluginId}@${version} in-process (sandbox bypassed)`);
|
|
@@ -1664,7 +1730,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1664
1730
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(body.data, collection, true)).content;
|
|
1665
1731
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, true);
|
|
1666
1732
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1667
|
-
const { validateContentData } = await import("../validation-
|
|
1733
|
+
const { validateContentData } = await import("../validation-BsVUJfsP.mjs");
|
|
1668
1734
|
const validation = await validateContentData(this.db, collection, processedData, { partial: false });
|
|
1669
1735
|
if (!validation.ok) return {
|
|
1670
1736
|
success: false,
|
|
@@ -1681,7 +1747,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1681
1747
|
return result;
|
|
1682
1748
|
}
|
|
1683
1749
|
async handleContentUpdate(collection, id, body) {
|
|
1684
|
-
const { ContentRepository } = await import("../content-
|
|
1750
|
+
const { ContentRepository } = await import("../content-Ci04z2z-.mjs").then((n) => n.n);
|
|
1685
1751
|
const repo = new ContentRepository(this.db);
|
|
1686
1752
|
const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
|
|
1687
1753
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1708,7 +1774,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1708
1774
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(bodyWithoutRev.data, collection, false)).content;
|
|
1709
1775
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, false);
|
|
1710
1776
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1711
|
-
const { validateContentData } = await import("../validation-
|
|
1777
|
+
const { validateContentData } = await import("../validation-BsVUJfsP.mjs");
|
|
1712
1778
|
const validation = await validateContentData(this.db, collection, processedData, { partial: true });
|
|
1713
1779
|
if (!validation.ok) return {
|
|
1714
1780
|
success: false,
|
|
@@ -1745,8 +1811,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1745
1811
|
const tableName = `ec_${collection}`;
|
|
1746
1812
|
await sql`
|
|
1747
1813
|
UPDATE ${sql.ref(tableName)}
|
|
1748
|
-
SET draft_revision_id = ${revision.id}
|
|
1749
|
-
updated_at = ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
1814
|
+
SET draft_revision_id = ${revision.id}
|
|
1750
1815
|
WHERE id = ${resolvedId}
|
|
1751
1816
|
`.execute(this.db);
|
|
1752
1817
|
draftStorageChanged = true;
|
|
@@ -1946,8 +2011,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1946
2011
|
const tableName = `ec_${revision.collection}`;
|
|
1947
2012
|
await sql`
|
|
1948
2013
|
UPDATE ${sql.ref(tableName)}
|
|
1949
|
-
SET draft_revision_id = ${newDraft.id}
|
|
1950
|
-
updated_at = ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
2014
|
+
SET draft_revision_id = ${newDraft.id}
|
|
1951
2015
|
WHERE id = ${revision.entryId}
|
|
1952
2016
|
`.execute(this.db);
|
|
1953
2017
|
revisionRepo.pruneOldRevisions(revision.collection, revision.entryId, 50).catch(() => {});
|
|
@@ -1993,7 +2057,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1993
2057
|
if (trustedPlugin) {
|
|
1994
2058
|
const route = trustedPlugin.routes[routeKey];
|
|
1995
2059
|
if (!route) return null;
|
|
1996
|
-
return
|
|
2060
|
+
return buildRouteMeta(route);
|
|
1997
2061
|
}
|
|
1998
2062
|
const meta = sandboxedRouteMetaCache.get(pluginId);
|
|
1999
2063
|
if (meta) {
|
|
@@ -2009,6 +2073,17 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2009
2073
|
if (this.findSandboxedPlugin(pluginId)) return { public: false };
|
|
2010
2074
|
return null;
|
|
2011
2075
|
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Resolve the settings schema for a runtime-installed (marketplace or
|
|
2078
|
+
* registry) plugin from its cached manifest. Returns `{}` for a known
|
|
2079
|
+
* plugin without a schema and `null` for unknown plugins, matching the
|
|
2080
|
+
* contract of `getPluginSettingsSchema` for build-time plugins.
|
|
2081
|
+
*/
|
|
2082
|
+
getRuntimePluginSettingsSchema(pluginId) {
|
|
2083
|
+
const meta = marketplaceManifestCache.get(pluginId);
|
|
2084
|
+
if (!meta) return null;
|
|
2085
|
+
return meta.admin?.settingsSchema ?? {};
|
|
2086
|
+
}
|
|
2012
2087
|
async handlePluginApiRoute(pluginId, _method, path, request) {
|
|
2013
2088
|
if (!this.isPluginEnabled(pluginId)) return {
|
|
2014
2089
|
success: false,
|
|
@@ -2020,9 +2095,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2020
2095
|
const trustedPlugin = this.configuredPlugins.find((p) => p.id === pluginId);
|
|
2021
2096
|
if (trustedPlugin && this.enabledPlugins.has(trustedPlugin.id)) {
|
|
2022
2097
|
const routeRegistry = new PluginRouteRegistry({
|
|
2023
|
-
|
|
2024
|
-
storage: this.storage ?? void 0,
|
|
2098
|
+
...this.pipelineFactoryOptions,
|
|
2025
2099
|
emailPipeline: this.email ?? void 0,
|
|
2100
|
+
cronReschedule: () => this.cronScheduler?.reschedule(),
|
|
2026
2101
|
trustedProxyHeaders: getTrustedProxyHeaders(this.config)
|
|
2027
2102
|
});
|
|
2028
2103
|
routeRegistry.register(trustedPlugin);
|
|
@@ -2046,6 +2121,116 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2046
2121
|
}
|
|
2047
2122
|
};
|
|
2048
2123
|
}
|
|
2124
|
+
async getPluginMcpTools(pluginId) {
|
|
2125
|
+
const tools = [];
|
|
2126
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2127
|
+
for (const plugin of this.configuredPlugins) {
|
|
2128
|
+
if (pluginId && plugin.id !== pluginId) continue;
|
|
2129
|
+
for (const [name, tool] of Object.entries(plugin.mcp?.tools ?? {})) {
|
|
2130
|
+
const route = plugin.routes[tool.route];
|
|
2131
|
+
if (!route || route.public || !route.permission || !(route.permission in Permissions)) continue;
|
|
2132
|
+
const key = `${plugin.id}__${name}`;
|
|
2133
|
+
if (seen.has(key)) continue;
|
|
2134
|
+
seen.add(key);
|
|
2135
|
+
tools.push({
|
|
2136
|
+
pluginId: plugin.id,
|
|
2137
|
+
name,
|
|
2138
|
+
description: tool.description,
|
|
2139
|
+
route: tool.route,
|
|
2140
|
+
permission: route.permission,
|
|
2141
|
+
destructive: tool.destructive ?? false,
|
|
2142
|
+
inputSchema: tool.input,
|
|
2143
|
+
outputSchema: tool.output
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
const addManifestTools = (id, mcp) => {
|
|
2148
|
+
if (pluginId && id !== pluginId) return;
|
|
2149
|
+
for (const tool of mcp?.tools ?? []) {
|
|
2150
|
+
const key = `${id}__${tool.name}`;
|
|
2151
|
+
const routeMeta = this.getPluginRouteMeta(id, tool.route);
|
|
2152
|
+
if (seen.has(key) || !routeMeta || routeMeta.public || routeMeta.permission !== tool.permission || !(tool.permission in Permissions)) continue;
|
|
2153
|
+
seen.add(key);
|
|
2154
|
+
tools.push({
|
|
2155
|
+
pluginId: id,
|
|
2156
|
+
name: tool.name,
|
|
2157
|
+
description: tool.description,
|
|
2158
|
+
route: tool.route,
|
|
2159
|
+
permission: tool.permission,
|
|
2160
|
+
destructive: tool.destructive,
|
|
2161
|
+
inputSchema: z.fromJSONSchema({ ...tool.inputSchema }),
|
|
2162
|
+
outputSchema: tool.outputSchema ? z.fromJSONSchema({ ...tool.outputSchema }) : void 0
|
|
2163
|
+
});
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
for (const entry of this.sandboxedPluginEntries) addManifestTools(entry.id, entry.mcp);
|
|
2167
|
+
for (const [id, manifest] of marketplaceManifestCache) addManifestTools(id, manifest.mcp);
|
|
2168
|
+
return tools;
|
|
2169
|
+
}
|
|
2170
|
+
async getEnabledPluginMcpTools() {
|
|
2171
|
+
const [tools, states] = await Promise.all([this.getPluginMcpTools(), new PluginStateRepository(this.db).getAll()]);
|
|
2172
|
+
const stateByPlugin = new Map(states.map((state) => [state.pluginId, state]));
|
|
2173
|
+
return tools.filter((tool) => {
|
|
2174
|
+
const state = stateByPlugin.get(tool.pluginId);
|
|
2175
|
+
if (!state?.mcpToolsEnabled || state.status !== "active" || !this.isPluginEnabled(tool.pluginId)) return false;
|
|
2176
|
+
return state.mcpToolsConsent === this.serializePluginMcpConsent(tools, tool.pluginId);
|
|
2177
|
+
});
|
|
2178
|
+
}
|
|
2179
|
+
serializePluginMcpConsent(tools, pluginId) {
|
|
2180
|
+
return JSON.stringify(tools.filter((tool) => tool.pluginId === pluginId).map((tool) => ({
|
|
2181
|
+
name: tool.name,
|
|
2182
|
+
description: tool.description,
|
|
2183
|
+
route: tool.route,
|
|
2184
|
+
permission: tool.permission,
|
|
2185
|
+
destructive: tool.destructive,
|
|
2186
|
+
inputSchema: z.toJSONSchema(tool.inputSchema, { target: "draft-7" }),
|
|
2187
|
+
...tool.outputSchema ? { outputSchema: z.toJSONSchema(tool.outputSchema, { target: "draft-7" }) } : {}
|
|
2188
|
+
})).toSorted((a, b) => a.name.localeCompare(b.name)));
|
|
2189
|
+
}
|
|
2190
|
+
async handlePluginMcpTool(pluginId, toolName, route, input, actorId, request) {
|
|
2191
|
+
const requestMeta = extractRequestMeta(request, getTrustedProxyHeaders(this.config));
|
|
2192
|
+
const audit = new AuditRepository(this.db);
|
|
2193
|
+
const headers = new Headers(request.headers);
|
|
2194
|
+
headers.delete("content-length");
|
|
2195
|
+
headers.delete("content-encoding");
|
|
2196
|
+
const internalRequest = new Request(request.url, {
|
|
2197
|
+
method: "POST",
|
|
2198
|
+
headers,
|
|
2199
|
+
body: JSON.stringify(input)
|
|
2200
|
+
});
|
|
2201
|
+
const result = await this.handlePluginApiRoute(pluginId, "POST", route, internalRequest);
|
|
2202
|
+
await audit.log({
|
|
2203
|
+
actorId,
|
|
2204
|
+
actorIp: requestMeta.ip ?? void 0,
|
|
2205
|
+
action: "plugin_tool_invoke",
|
|
2206
|
+
resourceType: "plugin_mcp_tool",
|
|
2207
|
+
resourceId: `${pluginId}__${toolName}`,
|
|
2208
|
+
details: {
|
|
2209
|
+
pluginId,
|
|
2210
|
+
tool: toolName,
|
|
2211
|
+
route
|
|
2212
|
+
},
|
|
2213
|
+
status: result.success ? "success" : "failure"
|
|
2214
|
+
});
|
|
2215
|
+
return result;
|
|
2216
|
+
}
|
|
2217
|
+
async handlePluginMcpDenied(pluginId, toolName, route, actorId, request, reason) {
|
|
2218
|
+
const requestMeta = extractRequestMeta(request, getTrustedProxyHeaders(this.config));
|
|
2219
|
+
await new AuditRepository(this.db).log({
|
|
2220
|
+
actorId,
|
|
2221
|
+
actorIp: requestMeta.ip ?? void 0,
|
|
2222
|
+
action: "plugin_tool_invoke",
|
|
2223
|
+
resourceType: "plugin_mcp_tool",
|
|
2224
|
+
resourceId: `${pluginId}__${toolName}`,
|
|
2225
|
+
details: {
|
|
2226
|
+
pluginId,
|
|
2227
|
+
tool: toolName,
|
|
2228
|
+
route,
|
|
2229
|
+
reason
|
|
2230
|
+
},
|
|
2231
|
+
status: "denied"
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2049
2234
|
findSandboxedPlugin(pluginId) {
|
|
2050
2235
|
for (const [key, plugin] of this.sandboxedPlugins) if (key.startsWith(pluginId + ":")) return plugin;
|
|
2051
2236
|
}
|
|
@@ -2595,6 +2780,16 @@ function createPublicPluginApiRouteHandler(runtime) {
|
|
|
2595
2780
|
*/
|
|
2596
2781
|
const RUNTIME_INIT_DEADLINE_MS = DB_INIT_DEADLINE_MS + 15e3;
|
|
2597
2782
|
/**
|
|
2783
|
+
* Throttle for the anonymous-path runtime-init failure log. While a site is
|
|
2784
|
+
* stuck (e.g. a failing migration in its backoff window, #1744) every
|
|
2785
|
+
* anonymous request lands in that catch; one line per interval per isolate
|
|
2786
|
+
* keeps the failure visible without flooding logs on a busy site. Plain
|
|
2787
|
+
* module state (not globalThis): a duplicated SSR chunk just means an extra
|
|
2788
|
+
* log line, which is harmless.
|
|
2789
|
+
*/
|
|
2790
|
+
const RUNTIME_INIT_ERROR_LOG_INTERVAL_MS = 3e4;
|
|
2791
|
+
let lastRuntimeInitErrorLogAt = 0;
|
|
2792
|
+
/**
|
|
2598
2793
|
* Whether we've verified the database has been set up.
|
|
2599
2794
|
* On a fresh deployment the first request may hit a public page, bypassing
|
|
2600
2795
|
* runtime init. Without this check, template helpers like getSiteSettings()
|
|
@@ -2718,6 +2913,63 @@ async function getRuntime(config, initTimings) {
|
|
|
2718
2913
|
async function runScheduledTasks(options = {}) {
|
|
2719
2914
|
const config = getConfig();
|
|
2720
2915
|
if (!config) return { published: [] };
|
|
2916
|
+
return runOutsideRequest(config, (runtime) => runtime.runScheduledTasks(options));
|
|
2917
|
+
}
|
|
2918
|
+
/**
|
|
2919
|
+
* Run a callback against the EmDash runtime outside any HTTP request — from a
|
|
2920
|
+
* Cloudflare Queue consumer, a `scheduled()` handler, or any other
|
|
2921
|
+
* platform-event handler that has no request and therefore no `locals.emdash`.
|
|
2922
|
+
*
|
|
2923
|
+
* Resolves the same cached runtime singleton request handlers use, so hooks,
|
|
2924
|
+
* plugin state, and storage all behave exactly as they do during a request.
|
|
2925
|
+
* A typical queue consumer finishes a job by calling back into a plugin route:
|
|
2926
|
+
*
|
|
2927
|
+
* ```ts
|
|
2928
|
+
* import { withEmDashRuntime } from "emdash/middleware";
|
|
2929
|
+
*
|
|
2930
|
+
* async function queue(batch: MessageBatch) {
|
|
2931
|
+
* await withEmDashRuntime(async (runtime) => {
|
|
2932
|
+
* for (const message of batch.messages) {
|
|
2933
|
+
* await runtime.handlePluginApiRoute(
|
|
2934
|
+
* "my-plugin",
|
|
2935
|
+
* "POST",
|
|
2936
|
+
* "/finishJob",
|
|
2937
|
+
* new Request("https://internal/", {
|
|
2938
|
+
* method: "POST",
|
|
2939
|
+
* body: JSON.stringify(message.body),
|
|
2940
|
+
* }),
|
|
2941
|
+
* );
|
|
2942
|
+
* }
|
|
2943
|
+
* });
|
|
2944
|
+
* }
|
|
2945
|
+
* ```
|
|
2946
|
+
*
|
|
2947
|
+
* Server-only and fully trusted: the callback gets the raw runtime with no
|
|
2948
|
+
* auth or CSRF checks, same trust level as plugin cron. Never expose it to
|
|
2949
|
+
* user input without validating that input yourself.
|
|
2950
|
+
*
|
|
2951
|
+
* Throws when EmDash is not configured (no `emdash()` Astro integration).
|
|
2952
|
+
*/
|
|
2953
|
+
async function withEmDashRuntime(run) {
|
|
2954
|
+
const config = getConfig();
|
|
2955
|
+
if (!config) throw new Error("EmDash is not configured — withEmDashRuntime() requires the emdash() Astro integration.");
|
|
2956
|
+
return runOutsideRequest(config, async (runtime) => run(runtime));
|
|
2957
|
+
}
|
|
2958
|
+
/**
|
|
2959
|
+
* Shared plumbing for request-free entry points (`runScheduledTasks`,
|
|
2960
|
+
* `withEmDashRuntime`): resolve the runtime singleton, then run the callback
|
|
2961
|
+
* under an event-scoped db connection when the adapter needs one.
|
|
2962
|
+
*
|
|
2963
|
+
* Connection-backed adapters (e.g. Postgres over Hyperdrive) cannot reuse
|
|
2964
|
+
* the per-isolate singleton from a platform event: its socket belongs to the
|
|
2965
|
+
* request that opened it, and workerd rejects cross-event I/O. Open an
|
|
2966
|
+
* event-scoped connection and run the callback under it in ALS — the
|
|
2967
|
+
* runtime's db getter, the cron executor, and plugin contexts all resolve
|
|
2968
|
+
* the connection from ALS — then close it. Gated on the adapter being
|
|
2969
|
+
* connection-backed (it exposes `close()`); stateless adapters (D1, Node
|
|
2970
|
+
* SQLite) return null or a close-less scope and keep using the singleton.
|
|
2971
|
+
*/
|
|
2972
|
+
async function runOutsideRequest(config, fn) {
|
|
2721
2973
|
const runtime = await getRuntime(config);
|
|
2722
2974
|
const scoped = createRequestScopedDb$1({
|
|
2723
2975
|
config: config.database?.config,
|
|
@@ -2726,7 +2978,7 @@ async function runScheduledTasks(options = {}) {
|
|
|
2726
2978
|
cookies: NOOP_COOKIE_JAR,
|
|
2727
2979
|
url: CRON_EVENT_URL
|
|
2728
2980
|
});
|
|
2729
|
-
if (!scoped?.close) return runtime
|
|
2981
|
+
if (!scoped?.close) return fn(runtime);
|
|
2730
2982
|
const parent = getRequestContext();
|
|
2731
2983
|
const ctx = parent ? {
|
|
2732
2984
|
...parent,
|
|
@@ -2737,17 +2989,17 @@ async function runScheduledTasks(options = {}) {
|
|
|
2737
2989
|
metrics: createRequestMetrics(performance.now())
|
|
2738
2990
|
};
|
|
2739
2991
|
try {
|
|
2740
|
-
return await runWithContext(ctx, () => runtime
|
|
2992
|
+
return await runWithContext(ctx, () => fn(runtime));
|
|
2741
2993
|
} finally {
|
|
2742
2994
|
try {
|
|
2743
2995
|
scoped.commit();
|
|
2744
2996
|
} catch (error) {
|
|
2745
|
-
console.error("[
|
|
2997
|
+
console.error("[emdash] event-scoped db commit failed:", error);
|
|
2746
2998
|
}
|
|
2747
2999
|
try {
|
|
2748
3000
|
scoped.close();
|
|
2749
3001
|
} catch (error) {
|
|
2750
|
-
console.error("[
|
|
3002
|
+
console.error("[emdash] event-scoped db close failed:", error);
|
|
2751
3003
|
}
|
|
2752
3004
|
}
|
|
2753
3005
|
}
|
|
@@ -2871,7 +3123,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2871
3123
|
if (!isSetupVerified() && !context.isPrerendered) {
|
|
2872
3124
|
const t0 = performance.now();
|
|
2873
3125
|
try {
|
|
2874
|
-
const { getDb } = await import("../loader-
|
|
3126
|
+
const { getDb } = await import("../loader-Be3ouI5L.mjs").then((n) => n.o);
|
|
2875
3127
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
2876
3128
|
markSetupVerified();
|
|
2877
3129
|
} catch (error) {
|
|
@@ -2898,7 +3150,12 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2898
3150
|
getPublicMediaUrl: createPublicMediaUrlResolver(runtime.storage),
|
|
2899
3151
|
storage: runtime.storage
|
|
2900
3152
|
};
|
|
2901
|
-
} catch {
|
|
3153
|
+
} catch (error) {
|
|
3154
|
+
if (Date.now() - lastRuntimeInitErrorLogAt >= RUNTIME_INIT_ERROR_LOG_INTERVAL_MS) {
|
|
3155
|
+
lastRuntimeInitErrorLogAt = Date.now();
|
|
3156
|
+
console.error("[emdash] runtime init failed (page renders without CMS data):", error);
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
2902
3159
|
timings.push({
|
|
2903
3160
|
name: "rt",
|
|
2904
3161
|
dur: performance.now() - t0,
|
|
@@ -2999,6 +3256,11 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2999
3256
|
handlePluginApiRoute: runtime.handlePluginApiRoute.bind(runtime),
|
|
3000
3257
|
handlePublicPluginApiRoute: createPublicPluginApiRouteHandler(runtime),
|
|
3001
3258
|
getPluginRouteMeta: runtime.getPluginRouteMeta.bind(runtime),
|
|
3259
|
+
getPluginMcpTools: runtime.getPluginMcpTools.bind(runtime),
|
|
3260
|
+
getEnabledPluginMcpTools: runtime.getEnabledPluginMcpTools.bind(runtime),
|
|
3261
|
+
serializePluginMcpConsent: runtime.serializePluginMcpConsent.bind(runtime),
|
|
3262
|
+
handlePluginMcpTool: runtime.handlePluginMcpTool.bind(runtime),
|
|
3263
|
+
handlePluginMcpDenied: runtime.handlePluginMcpDenied.bind(runtime),
|
|
3002
3264
|
getMediaProvider: runtime.getMediaProvider.bind(runtime),
|
|
3003
3265
|
getMediaProviderList: runtime.getMediaProviderList.bind(runtime),
|
|
3004
3266
|
collectPageMetadata: runtime.collectPageMetadata.bind(runtime),
|
|
@@ -3090,5 +3352,5 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3090
3352
|
});
|
|
3091
3353
|
|
|
3092
3354
|
//#endregion
|
|
3093
|
-
export { onRequest as default, onRequest, runScheduledTasks };
|
|
3355
|
+
export { onRequest as default, onRequest, runScheduledTasks, withEmDashRuntime };
|
|
3094
3356
|
//# sourceMappingURL=middleware.mjs.map
|