emdash 1.0.0 → 1.0.1-rc.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/README.md +4 -0
- package/dist/action-token-DBki7IT4.mjs +26 -0
- package/dist/action-token-DBki7IT4.mjs.map +1 -0
- package/dist/activation-DDuqAat2.mjs +387 -0
- package/dist/activation-DDuqAat2.mjs.map +1 -0
- package/dist/adapters-DcqT_GzQ.d.mts +171 -0
- package/dist/adapters-DcqT_GzQ.d.mts.map +1 -0
- package/dist/after-PcEvMY_6.mjs +96 -0
- package/dist/after-PcEvMY_6.mjs.map +1 -0
- package/dist/allowed-origins-CFtudhyw.mjs +116 -0
- package/dist/allowed-origins-CFtudhyw.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +69 -0
- package/dist/api/route-utils.d.mts.map +1 -0
- package/dist/api/route-utils.mjs +85 -0
- package/dist/api/route-utils.mjs.map +1 -0
- package/dist/api/schemas/index.d.mts +2 -0
- package/dist/api/schemas/index.mjs +13 -0
- package/dist/api-BJFwdTiG.mjs +4974 -0
- package/dist/api-BJFwdTiG.mjs.map +1 -0
- package/dist/api-tokens-BLz2MtQs.mjs +3 -0
- package/dist/api-tokens-P3mAaQgr.mjs +166 -0
- package/dist/api-tokens-P3mAaQgr.mjs.map +1 -0
- package/dist/apply-BNvvsD51.mjs +1672 -0
- package/dist/apply-BNvvsD51.mjs.map +1 -0
- package/dist/approvals-quy61IC4.mjs +460 -0
- package/dist/approvals-quy61IC4.mjs.map +1 -0
- package/dist/artifact-fetch-CWxyELVI.mjs +659 -0
- package/dist/artifact-fetch-CWxyELVI.mjs.map +1 -0
- package/dist/astro/image-endpoint.d.mts +8 -0
- package/dist/astro/image-endpoint.d.mts.map +1 -0
- package/dist/astro/image-endpoint.mjs +55 -0
- package/dist/astro/image-endpoint.mjs.map +1 -0
- package/dist/astro/index.d.mts +39 -7
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +908 -514
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +15 -7
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +146 -211
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.d.mts +15 -0
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs +117 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -0
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +48 -15
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.d.mts +5 -1
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +542 -76
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +66 -4
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +817 -1844
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/PluginRegistry.d.mts +19 -0
- package/dist/astro/routes/PluginRegistry.d.mts.map +1 -0
- package/dist/astro/routes/PluginRegistry.mjs +26 -0
- package/dist/astro/routes/PluginRegistry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.d.mts +15 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +78 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.d.mts +15 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +78 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.d.mts +11 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +35 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/index.d.mts +17 -0
- package/dist/astro/routes/api/admin/api-tokens/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +54 -0
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts +8 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +25 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts +10 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +66 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/byline-fields/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +54 -0
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts +8 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +38 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts +10 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +92 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts +9 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +84 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/bylines/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/index.mjs +91 -0
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +59 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_.d.mts +15 -0
- package/dist/astro/routes/api/admin/comments/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_.mjs +51 -0
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/bulk.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/bulk.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/bulk.mjs +49 -0
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/counts.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/counts.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/counts.mjs +29 -0
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/index.d.mts +11 -0
- package/dist/astro/routes/api/admin/comments/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/index.mjs +53 -0
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/core-update.d.mts +8 -0
- package/dist/astro/routes/api/admin/core-update.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/core-update.mjs +28 -0
- package/dist/astro/routes/api/admin/core-update.mjs.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.d.mts +8 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +50 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +35 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +54 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +45 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +45 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +56 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -0
- 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 +53 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +46 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +46 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.d.mts +19 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +71 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.d.mts +15 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +52 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +28 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +28 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +105 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -0
- 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 +41 -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 +116 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +112 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +139 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/index.mjs +103 -0
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +44 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +99 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +142 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +106 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +112 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +160 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +362 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +155 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +221 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +117 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/updates.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/updates.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/updates.mjs +109 -0
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts +8 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +29 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +99 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +44 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +115 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.d.mts +12 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs +144 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +69 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +69 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +68 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs +71 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +68 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +71 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs +92 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +71 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +79 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +78 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +78 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +71 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +68 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs +100 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +45 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +34 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/users/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +117 -0
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +56 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/index.mjs +67 -0
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/dev-bypass.d.mts +9 -0
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/dev-bypass.mjs +83 -0
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/accept.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/accept.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/accept.mjs +36 -0
- package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/complete.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/complete.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/complete.mjs +70 -0
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/index.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/index.mjs +70 -0
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/register-options.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/register-options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/register-options.mjs +57 -0
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/logout.d.mts +8 -0
- package/dist/astro/routes/api/auth/logout.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/logout.mjs +29 -0
- package/dist/astro/routes/api/auth/logout.mjs.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/send.d.mts +8 -0
- package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/send.mjs +69 -0
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts +9 -0
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +59 -0
- package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/me.d.mts +14 -0
- package/dist/astro/routes/api/auth/me.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/me.mjs +71 -0
- package/dist/astro/routes/api/auth/me.mjs.map +1 -0
- package/dist/astro/routes/api/auth/mode.d.mts +8 -0
- package/dist/astro/routes/api/auth/mode.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/mode.mjs +34 -0
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts +8 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +149 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts +8 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +66 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/_id_.d.mts +15 -0
- package/dist/astro/routes/api/auth/passkey/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +75 -0
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/index.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/index.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/index.mjs +30 -0
- package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/options.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/options.mjs +50 -0
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/options.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/register/options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +57 -0
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +72 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/verify.mjs +63 -0
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/complete.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/complete.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/complete.mjs +71 -0
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/request.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/request.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/request.mjs +57 -0
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/verify.mjs +37 -0
- package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts +15 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +60 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +9 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +189 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +22 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +51 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +32 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts +10 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +73 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +25 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +38 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +135 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts +15 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +74 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts +8 -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 +80 -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 +75 -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.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +30 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +24 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts +9 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +85 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts +15 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +133 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +45 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +58 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts +10 -0
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +114 -0
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/authors.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/authors.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/authors.mjs +21 -0
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/index.d.mts +9 -0
- package/dist/astro/routes/api/content/_collection_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/index.mjs +77 -0
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/trash.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/trash.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/trash.mjs +36 -0
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -0
- package/dist/astro/routes/api/dashboard.d.mts +8 -0
- package/dist/astro/routes/api/dashboard.d.mts.map +1 -0
- package/dist/astro/routes/api/dashboard.mjs +37 -0
- package/dist/astro/routes/api/dashboard.mjs.map +1 -0
- package/dist/astro/routes/api/dev/emails.d.mts +9 -0
- package/dist/astro/routes/api/dev/emails.d.mts.map +1 -0
- package/dist/astro/routes/api/dev/emails.mjs +22 -0
- package/dist/astro/routes/api/dev/emails.mjs.map +1 -0
- package/dist/astro/routes/api/health.d.mts +8 -0
- package/dist/astro/routes/api/health.d.mts.map +1 -0
- package/dist/astro/routes/api/health.mjs +23 -0
- package/dist/astro/routes/api/health.mjs.map +1 -0
- package/dist/astro/routes/api/import/probe.d.mts +18 -0
- package/dist/astro/routes/api/import/probe.d.mts.map +1 -0
- package/dist/astro/routes/api/import/probe.mjs +56 -0
- package/dist/astro/routes/api/import/probe.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts +88 -0
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +315 -0
- package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +66 -0
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/execute.mjs +353 -0
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/media.d.mts +51 -0
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/media.mjs +241 -0
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/prepare.d.mts +20 -0
- package/dist/astro/routes/api/import/wordpress/prepare.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +131 -0
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +63 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +149 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +37 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +179 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +16 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +92 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.d.mts +8 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +29 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +60 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +718 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -0
- package/dist/astro/routes/api/manifest.d.mts +8 -0
- package/dist/astro/routes/api/manifest.d.mts.map +1 -0
- package/dist/astro/routes/api/manifest.mjs +65 -0
- package/dist/astro/routes/api/manifest.mjs.map +1 -0
- package/dist/astro/routes/api/mcp.d.mts +16 -0
- package/dist/astro/routes/api/mcp.d.mts.map +1 -0
- package/dist/astro/routes/api/mcp.mjs +2693 -0
- package/dist/astro/routes/api/mcp.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/confirm.d.mts +11 -0
- package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/confirm.mjs +178 -0
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/replace.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/replace.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/replace.mjs +99 -0
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/upload.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/upload.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/upload.mjs +170 -0
- package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -0
- 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 +60 -0
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_.d.mts +23 -0
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_.mjs +129 -0
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts +8 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +54 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -0
- package/dist/astro/routes/api/media/file/_...key_.d.mts +8 -0
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/file/_...key_.mjs +83 -0
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -0
- package/dist/astro/routes/api/media/folders/_id_.d.mts +10 -0
- package/dist/astro/routes/api/media/folders/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs +60 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/media/folders/index.d.mts +9 -0
- package/dist/astro/routes/api/media/folders/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/index.mjs +49 -0
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts +15 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +54 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.d.mts +15 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +77 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/index.d.mts +11 -0
- package/dist/astro/routes/api/media/providers/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/index.mjs +23 -0
- package/dist/astro/routes/api/media/providers/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/upload-url.d.mts +11 -0
- package/dist/astro/routes/api/media/upload-url.d.mts.map +1 -0
- package/dist/astro/routes/api/media/upload-url.mjs +106 -0
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -0
- package/dist/astro/routes/api/media.d.mts +17 -0
- package/dist/astro/routes/api/media.d.mts.map +1 -0
- package/dist/astro/routes/api/media.mjs +211 -0
- package/dist/astro/routes/api/media.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts +9 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +68 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items.d.mts +8 -0
- package/dist/astro/routes/api/menus/_name_/items.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items.mjs +48 -0
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/menus/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +48 -0
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/translations.d.mts +9 -0
- package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/translations.mjs +79 -0
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_.d.mts +10 -0
- package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_.mjs +80 -0
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/menus/index.d.mts +9 -0
- package/dist/astro/routes/api/menus/index.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/index.mjs +57 -0
- package/dist/astro/routes/api/menus/index.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/authorize.d.mts +9 -0
- package/dist/astro/routes/api/oauth/authorize.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/authorize.mjs +276 -0
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/authorize.d.mts +9 -0
- package/dist/astro/routes/api/oauth/device/authorize.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/authorize.mjs +48 -0
- package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/code.d.mts +8 -0
- package/dist/astro/routes/api/oauth/device/code.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/code.mjs +38 -0
- package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/token.d.mts +8 -0
- package/dist/astro/routes/api/oauth/device/token.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/token.mjs +49 -0
- package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/register.d.mts +9 -0
- package/dist/astro/routes/api/oauth/register.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/register.mjs +123 -0
- package/dist/astro/routes/api/oauth/register.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token/refresh.d.mts +8 -0
- package/dist/astro/routes/api/oauth/token/refresh.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token/refresh.mjs +32 -0
- package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token/revoke.d.mts +8 -0
- package/dist/astro/routes/api/oauth/token/revoke.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token/revoke.mjs +29 -0
- package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token.d.mts +9 -0
- package/dist/astro/routes/api/oauth/token.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token.mjs +143 -0
- package/dist/astro/routes/api/oauth/token.mjs.map +1 -0
- package/dist/astro/routes/api/openapi.json.d.mts +8 -0
- package/dist/astro/routes/api/openapi.json.d.mts.map +1 -0
- package/dist/astro/routes/api/openapi.json.mjs +3676 -0
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts +13 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +44 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/404s/index.d.mts +10 -0
- package/dist/astro/routes/api/redirects/404s/index.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/404s/index.mjs +76 -0
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/404s/summary.d.mts +8 -0
- package/dist/astro/routes/api/redirects/404s/summary.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/404s/summary.mjs +48 -0
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/_id_.d.mts +10 -0
- package/dist/astro/routes/api/redirects/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/_id_.mjs +80 -0
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/index.d.mts +9 -0
- package/dist/astro/routes/api/redirects/index.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/index.mjs +63 -0
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -0
- 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 +94 -0
- package/dist/astro/routes/api/relations/_id_/index.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 +78 -0
- package/dist/astro/routes/api/relations/index.mjs.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.d.mts +8 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +21 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.d.mts +8 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.d.mts.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +48 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +109 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.d.mts +8 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +103 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -0
- package/dist/astro/routes/api/schema/block-types/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/block-types/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/index.mjs +109 -0
- package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts +10 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +123 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +111 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +102 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts +10 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +127 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/collections/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/index.mjs +111 -0
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs +101 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/index.d.mts +8 -0
- package/dist/astro/routes/api/schema/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/index.mjs +92 -0
- package/dist/astro/routes/api/schema/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.d.mts +8 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +103 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/schema/orphans/index.d.mts +8 -0
- package/dist/astro/routes/api/schema/orphans/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/orphans/index.mjs +98 -0
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -0
- package/dist/astro/routes/api/search/enable.d.mts +17 -0
- package/dist/astro/routes/api/search/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/search/enable.mjs +71 -0
- package/dist/astro/routes/api/search/enable.mjs.map +1 -0
- package/dist/astro/routes/api/search/index.d.mts +17 -0
- package/dist/astro/routes/api/search/index.d.mts.map +1 -0
- package/dist/astro/routes/api/search/index.mjs +66 -0
- package/dist/astro/routes/api/search/index.mjs.map +1 -0
- package/dist/astro/routes/api/search/rebuild.d.mts +14 -0
- package/dist/astro/routes/api/search/rebuild.d.mts.map +1 -0
- package/dist/astro/routes/api/search/rebuild.mjs +60 -0
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -0
- package/dist/astro/routes/api/search/stats.d.mts +11 -0
- package/dist/astro/routes/api/search/stats.d.mts.map +1 -0
- package/dist/astro/routes/api/search/stats.mjs +33 -0
- package/dist/astro/routes/api/search/stats.mjs.map +1 -0
- package/dist/astro/routes/api/search/suggest.d.mts +16 -0
- package/dist/astro/routes/api/search/suggest.d.mts.map +1 -0
- package/dist/astro/routes/api/search/suggest.mjs +55 -0
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -0
- package/dist/astro/routes/api/sections/_slug_.d.mts +10 -0
- package/dist/astro/routes/api/sections/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/sections/_slug_.mjs +77 -0
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/sections/index.d.mts +9 -0
- package/dist/astro/routes/api/sections/index.d.mts.map +1 -0
- package/dist/astro/routes/api/sections/index.mjs +60 -0
- package/dist/astro/routes/api/sections/index.mjs.map +1 -0
- 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 +50 -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 +26 -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 +37 -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 +54 -0
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/email.d.mts +18 -0
- package/dist/astro/routes/api/settings/email.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/email.mjs +107 -0
- package/dist/astro/routes/api/settings/email.mjs.map +1 -0
- package/dist/astro/routes/api/settings.d.mts +21 -0
- package/dist/astro/routes/api/settings.d.mts.map +1 -0
- package/dist/astro/routes/api/settings.mjs +76 -0
- package/dist/astro/routes/api/settings.mjs.map +1 -0
- package/dist/astro/routes/api/setup/admin-verify.d.mts +8 -0
- package/dist/astro/routes/api/setup/admin-verify.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/admin-verify.mjs +83 -0
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -0
- package/dist/astro/routes/api/setup/admin.d.mts +8 -0
- package/dist/astro/routes/api/setup/admin.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/admin.mjs +83 -0
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -0
- package/dist/astro/routes/api/setup/dev-bypass.d.mts +9 -0
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/dev-bypass.mjs +172 -0
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -0
- package/dist/astro/routes/api/setup/dev-reset.d.mts +8 -0
- package/dist/astro/routes/api/setup/dev-reset.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/dev-reset.mjs +27 -0
- package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -0
- package/dist/astro/routes/api/setup/index.d.mts +8 -0
- package/dist/astro/routes/api/setup/index.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/index.mjs +147 -0
- package/dist/astro/routes/api/setup/index.mjs.map +1 -0
- package/dist/astro/routes/api/setup/status.d.mts +8 -0
- package/dist/astro/routes/api/setup/status.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/status.mjs +62 -0
- package/dist/astro/routes/api/setup/status.mjs.map +1 -0
- package/dist/astro/routes/api/snapshot.d.mts +8 -0
- package/dist/astro/routes/api/snapshot.d.mts.map +1 -0
- package/dist/astro/routes/api/snapshot.mjs +68 -0
- package/dist/astro/routes/api/snapshot.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +57 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts +9 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +92 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +103 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts +15 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +83 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +55 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs +104 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +297 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.d.mts +15 -0
- package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +75 -0
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -0
- package/dist/astro/routes/api/themes/preview.d.mts +8 -0
- package/dist/astro/routes/api/themes/preview.d.mts.map +1 -0
- package/dist/astro/routes/api/themes/preview.mjs +52 -0
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -0
- package/dist/astro/routes/api/typegen.d.mts +18 -0
- package/dist/astro/routes/api/typegen.d.mts.map +1 -0
- package/dist/astro/routes/api/typegen.mjs +50 -0
- package/dist/astro/routes/api/typegen.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/action-token.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/action-token.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/action-token.mjs +27 -0
- package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +44 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +22 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/auth.d.mts +8 -0
- package/dist/astro/routes/api/well-known/auth.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/auth.mjs +42 -0
- package/dist/astro/routes/api/well-known/auth.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts +8 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +33 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts +8 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +22 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +49 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +78 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts +8 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +64 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_.mjs +55 -0
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/index.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/index.mjs +74 -0
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -0
- package/dist/astro/routes/api/widget-components.d.mts +8 -0
- package/dist/astro/routes/api/widget-components.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-components.mjs +20 -0
- package/dist/astro/routes/api/widget-components.mjs.map +1 -0
- package/dist/astro/routes/robots.txt.d.mts +8 -0
- package/dist/astro/routes/robots.txt.d.mts.map +1 -0
- package/dist/astro/routes/robots.txt.mjs +65 -0
- package/dist/astro/routes/robots.txt.mjs.map +1 -0
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts +8 -0
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -0
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +131 -0
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -0
- package/dist/astro/routes/sitemap.xml.d.mts +8 -0
- package/dist/astro/routes/sitemap.xml.d.mts.map +1 -0
- package/dist/astro/routes/sitemap.xml.mjs +68 -0
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -0
- package/dist/astro/types.d.mts +246 -25
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/audit-BszbE_BP.mjs +127 -0
- package/dist/audit-BszbE_BP.mjs.map +1 -0
- package/dist/auth/providers/github.d.mts +13 -0
- package/dist/auth/providers/github.d.mts.map +1 -0
- package/dist/auth/providers/github.mjs +18 -0
- package/dist/auth/providers/github.mjs.map +1 -0
- package/dist/auth/providers/google.d.mts +13 -0
- package/dist/auth/providers/google.d.mts.map +1 -0
- package/dist/auth/providers/google.mjs +18 -0
- package/dist/auth/providers/google.mjs.map +1 -0
- package/dist/authoritative-records-dSvXCfzb.mjs +5172 -0
- package/dist/authoritative-records-dSvXCfzb.mjs.map +1 -0
- package/dist/authorize-CJtizVbp.mjs +49 -0
- package/dist/authorize-CJtizVbp.mjs.map +1 -0
- package/dist/backup-Cpl8TqRz.mjs +246 -0
- package/dist/backup-Cpl8TqRz.mjs.map +1 -0
- package/dist/base64-DvnNgP7e.mjs +63 -0
- package/dist/base64-DvnNgP7e.mjs.map +1 -0
- package/dist/block-types-DIG_KZwi.mjs +132 -0
- package/dist/block-types-DIG_KZwi.mjs.map +1 -0
- package/dist/block-values-BrTrtA-v.mjs +175 -0
- package/dist/block-values-BrTrtA-v.mjs.map +1 -0
- package/dist/byline-02tu_Uc-.mjs +909 -0
- package/dist/byline-02tu_Uc-.mjs.map +1 -0
- package/dist/byline-fields-DHJs0Mja.mjs +280 -0
- package/dist/byline-fields-DHJs0Mja.mjs.map +1 -0
- package/dist/byline-fields-xdxE9kxZ.mjs +123 -0
- package/dist/byline-fields-xdxE9kxZ.mjs.map +1 -0
- package/dist/byline-registry-dvt4N3xV.mjs +406 -0
- package/dist/byline-registry-dvt4N3xV.mjs.map +1 -0
- package/dist/bylines-CTGTsEAs.mjs +150 -0
- package/dist/bylines-CTGTsEAs.mjs.map +1 -0
- package/dist/bylines-DATJ0B8u.mjs +214 -0
- package/dist/bylines-DATJ0B8u.mjs.map +1 -0
- package/dist/cache-CPanL9IO.mjs +114 -0
- package/dist/cache-CPanL9IO.mjs.map +1 -0
- package/dist/canonical-CAecl1UQ.mjs +174 -0
- package/dist/canonical-CAecl1UQ.mjs.map +1 -0
- package/dist/capture-triggers-CdZfvHtF.mjs +362 -0
- package/dist/capture-triggers-CdZfvHtF.mjs.map +1 -0
- package/dist/challenge-store-CxZxPqaw.mjs +51 -0
- package/dist/challenge-store-CxZxPqaw.mjs.map +1 -0
- package/dist/checksum-DtH6m5uk.mjs +162 -0
- package/dist/checksum-DtH6m5uk.mjs.map +1 -0
- package/dist/chrome-tags-CKELm-bo.mjs +24 -0
- package/dist/chrome-tags-CKELm-bo.mjs.map +1 -0
- package/dist/chunks-DBmkKmBH.mjs +25 -0
- package/dist/chunks-DBmkKmBH.mjs.map +1 -0
- package/dist/cli/index.mjs +3021 -1548
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1296 -11
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +313 -27
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-JecE26cS.mjs +436 -0
- package/dist/collection-deletion-JecE26cS.mjs.map +1 -0
- package/dist/collection-deletion-processor-DgCfF3a1.mjs +217 -0
- package/dist/collection-deletion-processor-DgCfF3a1.mjs.map +1 -0
- package/dist/collection-slugs-cache-BNRAPNiu.mjs +85 -0
- package/dist/collection-slugs-cache-BNRAPNiu.mjs.map +1 -0
- package/dist/comment-Cq1UYN8_.mjs +313 -0
- package/dist/comment-Cq1UYN8_.mjs.map +1 -0
- package/dist/comment-reaction-DPeGAfjd.mjs +85 -0
- package/dist/comment-reaction-DPeGAfjd.mjs.map +1 -0
- package/dist/comments-BRtp992B.mjs +99 -0
- package/dist/comments-BRtp992B.mjs.map +1 -0
- package/dist/comments-Bi2j9IoX.mjs +195 -0
- package/dist/comments-Bi2j9IoX.mjs.map +1 -0
- package/dist/components-CQY-Sgm-.mjs +108 -0
- package/dist/components-CQY-Sgm-.mjs.map +1 -0
- package/dist/config-B-uePMLj.d.mts +39 -0
- package/dist/config-B-uePMLj.d.mts.map +1 -0
- package/dist/config-BVX7iYr4.d.mts +6679 -0
- package/dist/config-BVX7iYr4.d.mts.map +1 -0
- package/dist/config-CXPcy2iY.mjs +228 -0
- package/dist/config-CXPcy2iY.mjs.map +1 -0
- package/dist/config-CvmjJcVw.mjs +73 -0
- package/dist/config-CvmjJcVw.mjs.map +1 -0
- package/dist/connection-B9pIasFd.mjs +36 -0
- package/dist/connection-B9pIasFd.mjs.map +1 -0
- package/dist/content-RzEXY3QX.mjs +2020 -0
- package/dist/content-RzEXY3QX.mjs.map +1 -0
- package/dist/content-list-query-DiNwyKtd.d.mts +26 -0
- package/dist/content-list-query-DiNwyKtd.d.mts.map +1 -0
- package/dist/content-policy-Dm32n9C6.mjs +46 -0
- package/dist/content-policy-Dm32n9C6.mjs.map +1 -0
- package/dist/content-repair-B-k5JrVN.mjs +442 -0
- package/dist/content-repair-B-k5JrVN.mjs.map +1 -0
- package/dist/context-CTkYVMZV.mjs +2026 -0
- package/dist/context-CTkYVMZV.mjs.map +1 -0
- package/dist/credits-CAFPFhuk.mjs +110 -0
- package/dist/credits-CAFPFhuk.mjs.map +1 -0
- package/dist/cron-xe5XKqA-.mjs +306 -0
- package/dist/cron-xe5XKqA-.mjs.map +1 -0
- package/dist/dashboard-BoV4pwPP.mjs +151 -0
- package/dist/dashboard-BoV4pwPP.mjs.map +1 -0
- package/dist/database/instrumentation.d.mts +35 -5
- package/dist/database/instrumentation.d.mts.map +1 -1
- package/dist/database/instrumentation.mjs +40 -9
- package/dist/database/instrumentation.mjs.map +1 -1
- package/dist/database/migration-lock.d.mts +37 -0
- package/dist/database/migration-lock.d.mts.map +1 -0
- package/dist/database/migration-lock.mjs +76 -0
- package/dist/database/migration-lock.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 +42 -0
- package/dist/database/pg-migration-lock.mjs.map +1 -0
- package/dist/datetime-normalization-PeiEdcRY.mjs +187 -0
- package/dist/datetime-normalization-PeiEdcRY.mjs.map +1 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +35 -10
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +11 -0
- package/dist/db/libsql-migrations.d.mts.map +1 -0
- package/dist/db/libsql-migrations.mjs +58 -0
- package/dist/db/libsql-migrations.mjs.map +1 -0
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/libsql.d.mts.map +1 -1
- package/dist/db/libsql.mjs +7 -2
- package/dist/db/libsql.mjs.map +1 -1
- package/dist/db/postgres-migrations.d.mts +10 -0
- package/dist/db/postgres-migrations.d.mts.map +1 -0
- package/dist/db/postgres-migrations.mjs +48 -0
- package/dist/db/postgres-migrations.mjs.map +1 -0
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/postgres.d.mts.map +1 -1
- package/dist/db/postgres.mjs +20 -10
- package/dist/db/postgres.mjs.map +1 -1
- package/dist/db/sqlite-migrations.d.mts +10 -0
- package/dist/db/sqlite-migrations.d.mts.map +1 -0
- package/dist/db/sqlite-migrations.mjs +29 -0
- package/dist/db/sqlite-migrations.mjs.map +1 -0
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.d.mts.map +1 -1
- package/dist/db/sqlite.mjs +9 -4
- package/dist/db/sqlite.mjs.map +1 -1
- package/dist/db-errors-CBD5yMro.mjs +55 -0
- package/dist/db-errors-CBD5yMro.mjs.map +1 -0
- package/dist/default-DaoYyFRS.mjs +81 -0
- package/dist/default-DaoYyFRS.mjs.map +1 -0
- package/dist/deferred-tasks-BYcDx2o_.d.mts +9 -0
- package/dist/deferred-tasks-BYcDx2o_.d.mts.map +1 -0
- package/dist/destination-r2zIAZ2S.mjs +18 -0
- package/dist/destination-r2zIAZ2S.mjs.map +1 -0
- package/dist/dev-typegen-8JlYYFno.mjs +29 -0
- package/dist/dev-typegen-8JlYYFno.mjs.map +1 -0
- package/dist/device-flow-Ma5P5d2e.mjs +521 -0
- package/dist/device-flow-Ma5P5d2e.mjs.map +1 -0
- package/dist/dialect-helpers-7_IqPdh9.mjs +307 -0
- package/dist/dialect-helpers-7_IqPdh9.mjs.map +1 -0
- package/dist/digest-DiYAoZpf.mjs +194 -0
- package/dist/digest-DiYAoZpf.mjs.map +1 -0
- package/dist/direct-executor-FCIRepAU.mjs +104 -0
- package/dist/direct-executor-FCIRepAU.mjs.map +1 -0
- package/dist/dist-Cfu8mMBs.mjs +810 -0
- package/dist/dist-Cfu8mMBs.mjs.map +1 -0
- package/dist/email-console-DmqVF5J_.mjs +50 -0
- package/dist/email-console-DmqVF5J_.mjs.map +1 -0
- package/dist/email-locale-Cc5YSXfJ.mjs +25 -0
- package/dist/email-locale-Cc5YSXfJ.mjs.map +1 -0
- package/dist/emdash-runtime-YPrVnr6x.mjs +4226 -0
- package/dist/emdash-runtime-YPrVnr6x.mjs.map +1 -0
- package/dist/enrich-BDdVNeDK.mjs +194 -0
- package/dist/enrich-BDdVNeDK.mjs.map +1 -0
- package/dist/entry-lock-BtDo1zFm.d.mts +4544 -0
- package/dist/entry-lock-BtDo1zFm.d.mts.map +1 -0
- package/dist/entry-lock-PP1JCXBB.mjs +1180 -0
- package/dist/entry-lock-PP1JCXBB.mjs.map +1 -0
- package/dist/entry-lock-WyppUeRW.mjs +163 -0
- package/dist/entry-lock-WyppUeRW.mjs.map +1 -0
- package/dist/entry-locks-DJAqVweV.mjs +167 -0
- package/dist/entry-locks-DJAqVweV.mjs.map +1 -0
- package/dist/env-types-BaTCgn-y.mjs +38 -0
- package/dist/env-types-BaTCgn-y.mjs.map +1 -0
- package/dist/error-CEdm_AWU.mjs +90 -0
- package/dist/error-CEdm_AWU.mjs.map +1 -0
- package/dist/errors-9P_FDrJ_.mjs +17 -0
- package/dist/errors-9P_FDrJ_.mjs.map +1 -0
- package/dist/errors-CNvATh_7.mjs +469 -0
- package/dist/errors-CNvATh_7.mjs.map +1 -0
- package/dist/errors-CjXd1LgH.mjs +120 -0
- package/dist/errors-CjXd1LgH.mjs.map +1 -0
- package/dist/escape-nJW7dR0s.mjs +9 -0
- package/dist/escape-nJW7dR0s.mjs.map +1 -0
- package/dist/fence-BrnQffdY.mjs +162 -0
- package/dist/fence-BrnQffdY.mjs.map +1 -0
- package/dist/field-defs-cache-DEkFYCDE.mjs +77 -0
- package/dist/field-defs-cache-DEkFYCDE.mjs.map +1 -0
- package/dist/field-map-BfYMstlG.mjs +83 -0
- package/dist/field-map-BfYMstlG.mjs.map +1 -0
- package/dist/focal-point-JX8kcOTQ.mjs +23 -0
- package/dist/focal-point-JX8kcOTQ.mjs.map +1 -0
- package/dist/fts-manager-DU03MxWu.mjs +443 -0
- package/dist/fts-manager-DU03MxWu.mjs.map +1 -0
- package/dist/gc-BO9NqlAe.mjs +75 -0
- package/dist/gc-BO9NqlAe.mjs.map +1 -0
- package/dist/hash-CY4QdeMJ.mjs +37 -0
- package/dist/hash-CY4QdeMJ.mjs.map +1 -0
- package/dist/hook-result-DSRRxu_-.d.mts +31 -0
- package/dist/hook-result-DSRRxu_-.d.mts.map +1 -0
- package/dist/hreflang--av8HanY.d.mts +50 -0
- package/dist/hreflang--av8HanY.d.mts.map +1 -0
- package/dist/hreflang-CNbZjm4g.mjs +105 -0
- package/dist/hreflang-CNbZjm4g.mjs.map +1 -0
- package/dist/http-route-dispatch-16nzAM5m.mjs +339 -0
- package/dist/http-route-dispatch-16nzAM5m.mjs.map +1 -0
- package/dist/identity-DNaOsiip.mjs +35 -0
- package/dist/identity-DNaOsiip.mjs.map +1 -0
- package/dist/import-DUV3Gl6-.mjs +2020 -0
- package/dist/import-DUV3Gl6-.mjs.map +1 -0
- package/dist/index-m-lYQRqs.d.mts +623 -0
- package/dist/index-m-lYQRqs.d.mts.map +1 -0
- package/dist/index.d.mts +27 -11
- package/dist/index.mjs +120 -28
- package/dist/init-lock-4eRRB4Le.mjs +56 -0
- package/dist/init-lock-4eRRB4Le.mjs.map +1 -0
- package/dist/install-finalization-CPM7Gged.mjs +58 -0
- package/dist/install-finalization-CPM7Gged.mjs.map +1 -0
- package/dist/keys-B8g41vwJ.mjs +61 -0
- package/dist/keys-B8g41vwJ.mjs.map +1 -0
- package/dist/kinds-BKu9nb7q.mjs +974 -0
- package/dist/kinds-BKu9nb7q.mjs.map +1 -0
- package/dist/lifecycle-CpebZNAA.mjs +25 -0
- package/dist/lifecycle-CpebZNAA.mjs.map +1 -0
- package/dist/load-dHcR5yh9.mjs +28 -0
- package/dist/load-dHcR5yh9.mjs.map +1 -0
- package/dist/loader-CWb-ja1p.mjs +1197 -0
- package/dist/loader-CWb-ja1p.mjs.map +1 -0
- package/dist/loops-Dn1i16FP.mjs +205 -0
- package/dist/loops-Dn1i16FP.mjs.map +1 -0
- package/dist/manifest-builder-0ZHXBxOL.mjs +189 -0
- package/dist/manifest-builder-0ZHXBxOL.mjs.map +1 -0
- package/dist/manifest-schema-gy37bD_D.mjs +496 -0
- package/dist/manifest-schema-gy37bD_D.mjs.map +1 -0
- package/dist/marketplace-tHWSsCUo.mjs +257 -0
- package/dist/marketplace-tHWSsCUo.mjs.map +1 -0
- package/dist/media/image-endpoint.d.mts +104 -0
- package/dist/media/image-endpoint.d.mts.map +1 -0
- package/dist/media/image-endpoint.mjs +190 -0
- package/dist/media/image-endpoint.mjs.map +1 -0
- package/dist/media/index.d.mts +45 -2
- package/dist/media/index.d.mts.map +1 -1
- package/dist/media/index.mjs +17 -3
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +24 -7
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +41 -12
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-3v7mqAVX.mjs +294 -0
- package/dist/media-3v7mqAVX.mjs.map +1 -0
- package/dist/media-CputjGE1.mjs +373 -0
- package/dist/media-CputjGE1.mjs.map +1 -0
- package/dist/media-D1z_jisb.mjs +408 -0
- package/dist/media-D1z_jisb.mjs.map +1 -0
- package/dist/media-allowlist-D5a4d-RA.mjs +44 -0
- package/dist/media-allowlist-D5a4d-RA.mjs.map +1 -0
- package/dist/media-folders-D2VdVBf6.mjs +210 -0
- package/dist/media-folders-D2VdVBf6.mjs.map +1 -0
- package/dist/media-url-DloW2xrP.mjs +43 -0
- package/dist/media-url-DloW2xrP.mjs.map +1 -0
- package/dist/media-usage-B8q0owWQ.mjs +1629 -0
- package/dist/media-usage-B8q0owWQ.mjs.map +1 -0
- package/dist/media-usage-activation-CQWOOTJi.mjs +78 -0
- package/dist/media-usage-activation-CQWOOTJi.mjs.map +1 -0
- package/dist/media-usage-work-BC0qpkMD.mjs +152 -0
- package/dist/media-usage-work-BC0qpkMD.mjs.map +1 -0
- package/dist/media-usage-work-BlMjwPg8.mjs +586 -0
- package/dist/media-usage-work-BlMjwPg8.mjs.map +1 -0
- package/dist/menus-BQKqf0Up.mjs +92 -0
- package/dist/menus-BQKqf0Up.mjs.map +1 -0
- package/dist/menus-XQdKk-87.mjs +3647 -0
- package/dist/menus-XQdKk-87.mjs.map +1 -0
- package/dist/menus-trvc6_fW.mjs +753 -0
- package/dist/menus-trvc6_fW.mjs.map +1 -0
- package/dist/migrations/index.d.mts +22 -0
- package/dist/migrations/index.d.mts.map +1 -0
- package/dist/migrations/index.mjs +8 -0
- package/dist/mime-IZf-LHIS.mjs +36 -0
- package/dist/mime-IZf-LHIS.mjs.map +1 -0
- package/dist/mode-nh0ppSX5.mjs +23 -0
- package/dist/mode-nh0ppSX5.mjs.map +1 -0
- package/dist/node-sqlite-compat-CDOEcc97.mjs +63 -0
- package/dist/node-sqlite-compat-CDOEcc97.mjs.map +1 -0
- package/dist/normalize-BuWa0lvd.mjs +191 -0
- package/dist/normalize-BuWa0lvd.mjs.map +1 -0
- package/dist/oauth-authorization-BtYQ80uU.mjs +274 -0
- package/dist/oauth-authorization-BtYQ80uU.mjs.map +1 -0
- package/dist/oauth-clients-C1S4NQHh.mjs +266 -0
- package/dist/oauth-clients-C1S4NQHh.mjs.map +1 -0
- package/dist/oauth-state-store-CpGi2FZH.mjs +50 -0
- package/dist/oauth-state-store-CpGi2FZH.mjs.map +1 -0
- package/dist/oauth-user-lookup-BNp1aFAr.mjs +26 -0
- package/dist/oauth-user-lookup-BNp1aFAr.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +15 -0
- package/dist/object-cache/memory.d.mts.map +1 -0
- package/dist/object-cache/memory.mjs +56 -0
- package/dist/object-cache/memory.mjs.map +1 -0
- package/dist/object-cache-Bo6DGaC9.mjs +586 -0
- package/dist/object-cache-Bo6DGaC9.mjs.map +1 -0
- package/dist/options-DhrI7eMv.mjs +208 -0
- package/dist/options-DhrI7eMv.mjs.map +1 -0
- package/dist/options-Dl_W57-_.d.mts +81 -0
- package/dist/options-Dl_W57-_.d.mts.map +1 -0
- package/dist/ownership-DoeAIuTg.mjs +12 -0
- package/dist/ownership-DoeAIuTg.mjs.map +1 -0
- package/dist/page/index.d.mts +19 -5
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +32 -7
- package/dist/page/index.mjs.map +1 -1
- package/dist/parse-Gt2l4Sld.mjs +81 -0
- package/dist/parse-Gt2l4Sld.mjs.map +1 -0
- package/dist/parse-QVS0t5oR.d.mts +172 -0
- package/dist/parse-QVS0t5oR.d.mts.map +1 -0
- package/dist/passkey-config-C-MxsV22.mjs +46 -0
- package/dist/passkey-config-C-MxsV22.mjs.map +1 -0
- package/dist/paths-CqFwkjY8.mjs +77 -0
- package/dist/paths-CqFwkjY8.mjs.map +1 -0
- package/dist/patterns-DyZJ67I7.mjs +140 -0
- package/dist/patterns-DyZJ67I7.mjs.map +1 -0
- package/dist/placeholder-Dn7MMdWr.d.mts +306 -0
- package/dist/placeholder-Dn7MMdWr.d.mts.map +1 -0
- package/dist/plan-D8s1n84S.mjs +135 -0
- package/dist/plan-D8s1n84S.mjs.map +1 -0
- package/dist/plugin-test-runtime.d.mts +120 -0
- package/dist/plugin-test-runtime.d.mts.map +1 -0
- package/dist/plugin-test-runtime.mjs +126 -0
- package/dist/plugin-types.d.mts +196 -0
- package/dist/plugin-types.d.mts.map +1 -0
- package/dist/plugin-types.mjs +18 -0
- package/dist/plugin-types.mjs.map +1 -0
- package/dist/plugin-utils.d.mts +36 -16
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugin-utils.mjs +19 -16
- package/dist/plugin-utils.mjs.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +23 -12
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +124 -28
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/plugins/host.d.mts +7 -0
- package/dist/plugins/host.mjs +59 -0
- package/dist/plugins/http-wire.d.mts +25 -0
- package/dist/plugins/http-wire.d.mts.map +1 -0
- package/dist/plugins/http-wire.mjs +148 -0
- package/dist/plugins/http-wire.mjs.map +1 -0
- package/dist/plugins/secret-redactor.d.mts +9 -0
- package/dist/plugins/secret-redactor.d.mts.map +1 -0
- package/dist/plugins/secret-redactor.mjs +51 -0
- package/dist/plugins/secret-redactor.mjs.map +1 -0
- package/dist/plugins-BpLkXA1S.mjs +277 -0
- package/dist/plugins-BpLkXA1S.mjs.map +1 -0
- package/dist/policy-C1qpNxrr.mjs +45 -0
- package/dist/policy-C1qpNxrr.mjs.map +1 -0
- package/dist/portable-text-BnRuiR1-.mjs +307 -0
- package/dist/portable-text-BnRuiR1-.mjs.map +1 -0
- package/dist/preview-DU5rwz_m.mjs +107 -0
- package/dist/preview-DU5rwz_m.mjs.map +1 -0
- package/dist/protocol-cEfbPvM6.d.mts +61 -0
- package/dist/protocol-cEfbPvM6.d.mts.map +1 -0
- package/dist/public-submission-x1eaT6Tx.mjs +250 -0
- package/dist/public-submission-x1eaT6Tx.mjs.map +1 -0
- package/dist/public-url-B5a0QAh6.mjs +101 -0
- package/dist/public-url-B5a0QAh6.mjs.map +1 -0
- package/dist/query-DSEkrw_m.mjs +41 -0
- package/dist/query-DSEkrw_m.mjs.map +1 -0
- package/dist/query-dHwqNf85.mjs +1161 -0
- package/dist/query-dHwqNf85.mjs.map +1 -0
- package/dist/rate-limit-BXx3Ecp9.mjs +120 -0
- package/dist/rate-limit-BXx3Ecp9.mjs.map +1 -0
- package/dist/receipt-RG5_pwsj.mjs +43 -0
- package/dist/receipt-RG5_pwsj.mjs.map +1 -0
- package/dist/redirect-BRoLiWQE.mjs +19 -0
- package/dist/redirect-BRoLiWQE.mjs.map +1 -0
- package/dist/redirect-BvFKh8Sz.mjs +416 -0
- package/dist/redirect-BvFKh8Sz.mjs.map +1 -0
- package/dist/redirects-CWQMKYOS.mjs +446 -0
- package/dist/redirects-CWQMKYOS.mjs.map +1 -0
- package/dist/redirects-D4EWeXAo.mjs +148 -0
- package/dist/redirects-D4EWeXAo.mjs.map +1 -0
- package/dist/registry/testing.d.mts +26 -0
- package/dist/registry/testing.d.mts.map +1 -0
- package/dist/registry/testing.mjs +265 -0
- package/dist/registry/testing.mjs.map +1 -0
- package/dist/registry-CtHRqVe-.mjs +6771 -0
- package/dist/registry-CtHRqVe-.mjs.map +1 -0
- package/dist/relations-CVI2nbrn.mjs +776 -0
- package/dist/relations-CVI2nbrn.mjs.map +1 -0
- package/dist/request-cache-C4CIo5ad.mjs +104 -0
- package/dist/request-cache-C4CIo5ad.mjs.map +1 -0
- package/dist/request-context.d.mts +45 -1
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs +17 -3
- package/dist/request-context.mjs.map +1 -1
- package/dist/request-meta-B6blULFY.mjs +141 -0
- package/dist/request-meta-B6blULFY.mjs.map +1 -0
- package/dist/resolve-Cw4rWFJl.mjs +100 -0
- package/dist/resolve-Cw4rWFJl.mjs.map +1 -0
- package/dist/resolve-D-kqyKns.mjs +199 -0
- package/dist/resolve-D-kqyKns.mjs.map +1 -0
- package/dist/revision-CGkQA0e5.mjs +366 -0
- package/dist/revision-CGkQA0e5.mjs.map +1 -0
- package/dist/route-wire-DK600v4u.mjs +197 -0
- package/dist/route-wire-DK600v4u.mjs.map +1 -0
- package/dist/routes-D0u5zK2P.mjs +272 -0
- package/dist/routes-D0u5zK2P.mjs.map +1 -0
- package/dist/runner-CC8LZx97.d.mts +68 -0
- package/dist/runner-CC8LZx97.d.mts.map +1 -0
- package/dist/runner-CLpxmhl8.mjs +6197 -0
- package/dist/runner-CLpxmhl8.mjs.map +1 -0
- package/dist/runtime.d.mts +13 -6
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +6 -4
- package/dist/runtime.mjs.map +1 -1
- package/dist/schema/project-env-types.d.mts +12 -0
- package/dist/schema/project-env-types.d.mts.map +1 -0
- package/dist/schema/project-env-types.mjs +86 -0
- package/dist/schema/project-env-types.mjs.map +1 -0
- package/dist/schema-BZPj3kwZ.mjs +13 -0
- package/dist/schema-BZPj3kwZ.mjs.map +1 -0
- package/dist/schema-Berj5VQx.mjs +815 -0
- package/dist/schema-Berj5VQx.mjs.map +1 -0
- package/dist/scopes-CxvclshI.mjs +34 -0
- package/dist/scopes-CxvclshI.mjs.map +1 -0
- package/dist/search-CD5MiMdh.mjs +448 -0
- package/dist/search-CD5MiMdh.mjs.map +1 -0
- package/dist/secrets-CIi0nFiR.mjs +341 -0
- package/dist/secrets-CIi0nFiR.mjs.map +1 -0
- package/dist/sections-Do5KdTSQ.mjs +346 -0
- package/dist/sections-Do5KdTSQ.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +47 -14
- package/dist/seo/index.d.mts +15 -2
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +39 -18
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-C61bnPuV.mjs +114 -0
- package/dist/seo-C61bnPuV.mjs.map +1 -0
- package/dist/seo-DpYxmGaL.mjs +133 -0
- package/dist/seo-DpYxmGaL.mjs.map +1 -0
- package/dist/service-BFUImckH.mjs +150 -0
- package/dist/service-BFUImckH.mjs.map +1 -0
- package/dist/session-user-DVcHsFD5.mjs +61 -0
- package/dist/session-user-DVcHsFD5.mjs.map +1 -0
- package/dist/settings-B0zQj_Tj.mjs +61 -0
- package/dist/settings-B0zQj_Tj.mjs.map +1 -0
- package/dist/settings-Ckzmx-A1.mjs +51 -0
- package/dist/settings-Ckzmx-A1.mjs.map +1 -0
- package/dist/settings-CnWoEDb0.mjs +439 -0
- package/dist/settings-CnWoEDb0.mjs.map +1 -0
- package/dist/setup-complete-B2_dhZZz.mjs +65 -0
- package/dist/setup-complete-B2_dhZZz.mjs.map +1 -0
- package/dist/setup-nonce-CJV9ftSK.mjs +25 -0
- package/dist/setup-nonce-CJV9ftSK.mjs.map +1 -0
- package/dist/single-flight-cache-B5O2qhO1.mjs +104 -0
- package/dist/single-flight-cache-B5O2qhO1.mjs.map +1 -0
- package/dist/site-settings-AYFvhwQn.mjs +50 -0
- package/dist/site-settings-AYFvhwQn.mjs.map +1 -0
- package/dist/site-url-Ceq_AUK0.mjs +16 -0
- package/dist/site-url-Ceq_AUK0.mjs.map +1 -0
- package/dist/slugify-T5GHH42D.mjs +17 -0
- package/dist/slugify-T5GHH42D.mjs.map +1 -0
- package/dist/snapshot-Dzsn3NZa.mjs +414 -0
- package/dist/snapshot-Dzsn3NZa.mjs.map +1 -0
- package/dist/ssrf-DsmvZB80.mjs +406 -0
- package/dist/ssrf-DsmvZB80.mjs.map +1 -0
- package/dist/ssrf-tA45vIPX.mjs +1 -0
- package/dist/stage-BcuakqfP.mjs +662 -0
- package/dist/stage-BcuakqfP.mjs.map +1 -0
- package/dist/staged-Bw5eHbKS.mjs +686 -0
- package/dist/staged-Bw5eHbKS.mjs.map +1 -0
- package/dist/state-kGdOMQRY.mjs +153 -0
- package/dist/state-kGdOMQRY.mjs.map +1 -0
- package/dist/status-D39Fpy8R.mjs +30 -0
- package/dist/status-D39Fpy8R.mjs.map +1 -0
- package/dist/storage/local.d.mts +2 -1
- package/dist/storage/local.d.mts.map +1 -1
- package/dist/storage/local.mjs +2 -2
- package/dist/storage/local.mjs.map +1 -1
- package/dist/storage/s3.d.mts +2 -1
- package/dist/storage/s3.d.mts.map +1 -1
- package/dist/storage/s3.mjs +4 -3
- package/dist/storage/s3.mjs.map +1 -1
- package/dist/storage-query-CKNIJhjo.d.mts +1614 -0
- package/dist/storage-query-CKNIJhjo.d.mts.map +1 -0
- package/dist/tar-n2OXqKpZ.mjs +449 -0
- package/dist/tar-n2OXqKpZ.mjs.map +1 -0
- package/dist/target-DOFs5oUC.mjs +27 -0
- package/dist/target-DOFs5oUC.mjs.map +1 -0
- package/dist/taxonomies-CMCnItWf.mjs +939 -0
- package/dist/taxonomies-CMCnItWf.mjs.map +1 -0
- package/dist/taxonomies-CvBe3xhM.mjs +697 -0
- package/dist/taxonomies-CvBe3xhM.mjs.map +1 -0
- package/dist/taxonomy-BesdHIwi.mjs +525 -0
- package/dist/taxonomy-BesdHIwi.mjs.map +1 -0
- package/dist/tokens-BIGxi8sP.mjs +171 -0
- package/dist/tokens-BIGxi8sP.mjs.map +1 -0
- package/dist/transaction-BVYIo_yu.mjs +29 -0
- package/dist/transaction-BVYIo_yu.mjs.map +1 -0
- package/dist/transfer-5Ce0QuNS.mjs +8856 -0
- package/dist/transfer-5Ce0QuNS.mjs.map +1 -0
- package/dist/transfer-CzdXsFRx.mjs +166 -0
- package/dist/transfer-CzdXsFRx.mjs.map +1 -0
- package/dist/transfer-download-Dc-ltjZY.mjs +33 -0
- package/dist/transfer-download-Dc-ltjZY.mjs.map +1 -0
- package/dist/transformations-BLzqMnpY.mjs +196 -0
- package/dist/transformations-BLzqMnpY.mjs.map +1 -0
- package/dist/transport-k1fykDBh.d.mts +42 -0
- package/dist/transport-k1fykDBh.d.mts.map +1 -0
- package/dist/transport-umzEbgYO.mjs +136 -0
- package/dist/transport-umzEbgYO.mjs.map +1 -0
- package/dist/trusted-proxy-BqfQFs6a.mjs +51 -0
- package/dist/trusted-proxy-BqfQFs6a.mjs.map +1 -0
- package/dist/turnstile-CvvKLtqE.mjs +53 -0
- package/dist/turnstile-CvvKLtqE.mjs.map +1 -0
- package/dist/types-B8tO_KdV.d.mts +896 -0
- package/dist/types-B8tO_KdV.d.mts.map +1 -0
- package/dist/types-BGmQ0uXs.mjs +201 -0
- package/dist/types-BGmQ0uXs.mjs.map +1 -0
- package/dist/types-BYaPWs_F.d.mts +198 -0
- package/dist/types-BYaPWs_F.d.mts.map +1 -0
- package/dist/types-CLTQ9b_r.d.mts +374 -0
- package/dist/types-CLTQ9b_r.d.mts.map +1 -0
- package/dist/types-CPkQw2T2.d.mts +85 -0
- package/dist/types-CPkQw2T2.d.mts.map +1 -0
- package/dist/types-CQLvuXoZ.d.mts +198 -0
- package/dist/types-CQLvuXoZ.d.mts.map +1 -0
- package/dist/types-CV5xszpF.d.mts +363 -0
- package/dist/types-CV5xszpF.d.mts.map +1 -0
- package/dist/types-CVsmpTcU.mjs +18 -0
- package/dist/types-CVsmpTcU.mjs.map +1 -0
- package/dist/types-CdEMurNh.mjs +77 -0
- package/dist/types-CdEMurNh.mjs.map +1 -0
- package/dist/types-CxwtnuSS.mjs +37 -0
- package/dist/types-CxwtnuSS.mjs.map +1 -0
- package/dist/types-DGw8KMX_.mjs +16 -0
- package/dist/types-DGw8KMX_.mjs.map +1 -0
- package/dist/types-DOfVMPoo.d.mts +125 -0
- package/dist/types-DOfVMPoo.d.mts.map +1 -0
- package/dist/types-Dsco9Y38.d.mts +1720 -0
- package/dist/types-Dsco9Y38.d.mts.map +1 -0
- package/dist/types-LtS0SM4F.d.mts +287 -0
- package/dist/types-LtS0SM4F.d.mts.map +1 -0
- package/dist/types-j6MBDjlZ.mjs +103 -0
- package/dist/types-j6MBDjlZ.mjs.map +1 -0
- package/dist/update-check-B2JKz5cr.mjs +161 -0
- package/dist/update-check-B2JKz5cr.mjs.map +1 -0
- package/dist/upload-attempts-BodUoFBu.mjs +32 -0
- package/dist/upload-attempts-BodUoFBu.mjs.map +1 -0
- package/dist/url-Dn3IStq8.mjs +104 -0
- package/dist/url-Dn3IStq8.mjs.map +1 -0
- package/dist/url-pattern-DGAG6ZP2.mjs +41 -0
- package/dist/url-pattern-DGAG6ZP2.mjs.map +1 -0
- package/dist/user-BOvuF1sQ.mjs +171 -0
- package/dist/user-BOvuF1sQ.mjs.map +1 -0
- package/dist/utils-CoV-PYhg.mjs +439 -0
- package/dist/utils-CoV-PYhg.mjs.map +1 -0
- package/dist/validate-DANX1-Qi.mjs +120 -0
- package/dist/validate-DANX1-Qi.mjs.map +1 -0
- package/dist/validate-DpP1QUiV.d.mts +468 -0
- package/dist/validate-DpP1QUiV.d.mts.map +1 -0
- package/dist/validate-WkjGwBSO.mjs +516 -0
- package/dist/validate-WkjGwBSO.mjs.map +1 -0
- package/dist/validation-DG7Y9H4u.mjs +219 -0
- package/dist/validation-DG7Y9H4u.mjs.map +1 -0
- package/dist/version-BnlfLUa6.mjs +7 -0
- package/dist/version-BnlfLUa6.mjs.map +1 -0
- package/dist/version-BwEGkqkx.mjs +9 -0
- package/dist/version-BwEGkqkx.mjs.map +1 -0
- package/dist/virtual-modules-B6vJW15k.mjs +516 -0
- package/dist/virtual-modules-B6vJW15k.mjs.map +1 -0
- package/dist/widgets-D7I_9xff.mjs +126 -0
- package/dist/widgets-D7I_9xff.mjs.map +1 -0
- package/dist/wxr-taxonomies-Di1w9HDU.d.mts +34 -0
- package/dist/wxr-taxonomies-Di1w9HDU.d.mts.map +1 -0
- package/dist/wxr-taxonomies-m_141EtN.mjs +453 -0
- package/dist/wxr-taxonomies-m_141EtN.mjs.map +1 -0
- package/dist/zod-generator-DnfG5sGQ.mjs +424 -0
- package/dist/zod-generator-DnfG5sGQ.mjs.map +1 -0
- package/locals.d.ts +1 -6
- package/package.json +142 -31
- package/src/after.ts +6 -1
- package/src/api/authorize.ts +27 -1
- package/src/api/email-locale.ts +24 -0
- package/src/api/error.ts +22 -7
- package/src/api/errors.ts +131 -0
- package/src/api/handlers/api-tokens.ts +37 -3
- package/src/api/handlers/backup.ts +318 -0
- package/src/api/handlers/block-types.ts +129 -0
- package/src/api/handlers/bulk-tag.ts +309 -0
- package/src/api/handlers/byline-fields.ts +212 -0
- package/src/api/handlers/bylines.ts +283 -0
- package/src/api/handlers/comment-reactions.ts +165 -0
- package/src/api/handlers/comments.ts +6 -32
- package/src/api/handlers/content.ts +1552 -156
- package/src/api/handlers/dashboard.ts +73 -38
- package/src/api/handlers/device-flow.ts +80 -23
- package/src/api/handlers/entry-lock.ts +206 -0
- package/src/api/handlers/index.ts +90 -0
- package/src/api/handlers/manifest.ts +245 -12
- package/src/api/handlers/marketplace.ts +251 -53
- package/src/api/handlers/media-allowlist.ts +52 -0
- package/src/api/handlers/media-folders.ts +130 -0
- package/src/api/handlers/media-upload.ts +186 -0
- package/src/api/handlers/media-usage-activation.ts +102 -0
- package/src/api/handlers/media-usage-work.ts +188 -0
- package/src/api/handlers/media-usage.ts +418 -0
- package/src/api/handlers/media.ts +207 -16
- package/src/api/handlers/menus.ts +294 -392
- package/src/api/handlers/oauth-authorization.ts +74 -39
- package/src/api/handlers/oauth-clients.ts +1 -1
- package/src/api/handlers/plugin-settings.ts +250 -0
- package/src/api/handlers/plugins.ts +195 -41
- package/src/api/handlers/redirects.ts +225 -131
- package/src/api/handlers/registry.ts +1844 -0
- package/src/api/handlers/relations.ts +960 -0
- package/src/api/handlers/revision.ts +70 -20
- package/src/api/handlers/schema.ts +486 -8
- package/src/api/handlers/seo.ts +68 -5
- package/src/api/handlers/settings.ts +2 -2
- package/src/api/handlers/snapshot.ts +359 -68
- package/src/api/handlers/staged-references.ts +208 -0
- package/src/api/handlers/taxonomies.ts +887 -156
- package/src/api/handlers/transfer.ts +1347 -0
- package/src/api/handlers/update-check.ts +236 -0
- package/src/api/handlers/validate-media-fields.ts +237 -0
- package/src/api/handlers/validate-references.ts +146 -0
- package/src/api/handlers/validation.ts +120 -19
- package/src/api/media-usage-write-fence.ts +43 -0
- package/src/api/openapi/document.ts +1644 -262
- package/src/api/parse.ts +3 -17
- package/src/api/public-url.ts +66 -6
- package/src/api/redirect.ts +9 -1
- package/src/api/schemas/auth.ts +10 -4
- package/src/api/schemas/byline-fields.ts +188 -0
- package/src/api/schemas/bylines.ts +97 -1
- package/src/api/schemas/comments.ts +19 -3
- package/src/api/schemas/common.ts +29 -9
- package/src/api/schemas/content.ts +302 -8
- package/src/api/schemas/entry-lock.ts +57 -0
- package/src/api/schemas/import.ts +69 -14
- package/src/api/schemas/index.ts +4 -0
- package/src/api/schemas/media-usage.ts +341 -0
- package/src/api/schemas/media.ts +186 -5
- package/src/api/schemas/menus.ts +50 -22
- package/src/api/schemas/redirects.ts +17 -5
- package/src/api/schemas/relations.ts +121 -0
- package/src/api/schemas/schema.ts +267 -7
- package/src/api/schemas/search.ts +7 -0
- package/src/api/schemas/sections.ts +3 -3
- package/src/api/schemas/settings.ts +41 -9
- package/src/api/schemas/setup.ts +1 -1
- package/src/api/schemas/taxonomies.ts +134 -10
- package/src/api/schemas/transfer.ts +249 -0
- package/src/api/schemas/users.ts +2 -2
- package/src/api/setup-complete.ts +49 -1
- package/src/api/site-url.ts +16 -6
- package/src/api/transfer-download.ts +36 -0
- package/src/api/types.ts +45 -10
- package/src/astro/dev-typegen.ts +28 -0
- package/src/astro/image-endpoint.ts +84 -0
- package/src/astro/index.ts +6 -0
- package/src/astro/integration/dev-typegen.ts +120 -0
- package/src/astro/integration/index.ts +501 -122
- package/src/astro/integration/route-naming.ts +19 -0
- package/src/astro/integration/routes.ts +367 -16
- package/src/astro/integration/runtime.ts +250 -24
- package/src/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
- package/src/astro/integration/shims/use-sync-external-store.js +1 -0
- package/src/astro/integration/virtual-modules.ts +213 -7
- package/src/astro/integration/vite-config.ts +261 -31
- package/src/astro/middleware/auth.ts +157 -102
- package/src/astro/middleware/csp.ts +79 -3
- package/src/astro/middleware/media-usage-write-fence.ts +125 -0
- package/src/astro/middleware/redirect.ts +68 -24
- package/src/astro/middleware/request-context.ts +223 -27
- package/src/astro/middleware/scoped-db.ts +183 -0
- package/src/astro/middleware/stream-end-metrics.ts +102 -0
- package/src/astro/middleware.ts +699 -115
- package/src/astro/object-cache/adapters.ts +50 -0
- package/src/astro/prefetch.ts +82 -0
- package/src/astro/public-plugin-api-routes.ts +42 -0
- package/src/astro/routes/PluginRegistry.tsx +5 -2
- package/src/astro/routes/admin.astro +74 -19
- package/src/astro/routes/api/admin/api-tokens/index.ts +6 -3
- package/src/astro/routes/api/admin/byline-fields/[slug]/usage.ts +36 -0
- package/src/astro/routes/api/admin/byline-fields/[slug].ts +92 -0
- package/src/astro/routes/api/admin/byline-fields/index.ts +66 -0
- package/src/astro/routes/api/admin/byline-fields/reorder.ts +39 -0
- package/src/astro/routes/api/admin/bylines/[id]/index.ts +34 -31
- package/src/astro/routes/api/admin/bylines/[id]/translations.ts +102 -0
- package/src/astro/routes/api/admin/bylines/index.ts +25 -11
- package/src/astro/routes/api/admin/comments/[id]/status.ts +23 -60
- package/src/astro/routes/api/admin/comments/index.ts +1 -2
- package/src/astro/routes/api/admin/core-update.ts +34 -0
- package/src/astro/routes/api/admin/hooks/exclusive/index.ts +1 -5
- package/src/astro/routes/api/admin/media-usage/activation.ts +42 -0
- package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/progress.ts +37 -0
- package/src/astro/routes/api/admin/media-usage/repair.ts +24 -0
- package/src/astro/routes/api/admin/media-usage/work/index.ts +26 -0
- package/src/astro/routes/api/admin/media-usage/work/retry.ts +26 -0
- package/src/astro/routes/api/admin/oauth-clients/[id].ts +1 -1
- package/src/astro/routes/api/admin/oauth-clients/index.ts +1 -1
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +7 -10
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +7 -10
- package/src/astro/routes/api/admin/plugins/[id]/index.ts +7 -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]/uninstall.ts +6 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +31 -4
- package/src/astro/routes/api/admin/plugins/index.ts +10 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/icon.ts +6 -2
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +25 -3
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +57 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +112 -0
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +538 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +134 -0
- package/src/astro/routes/api/admin/plugins/registry/publisher-handle.ts +59 -0
- package/src/astro/routes/api/admin/plugins/registry/verify.ts +61 -0
- package/src/astro/routes/api/admin/plugins/updates.ts +45 -6
- package/src/astro/routes/api/admin/scheduled-policy-rejections/[collection]/[id].ts +34 -0
- package/src/astro/routes/api/admin/themes/marketplace/[id]/thumbnail.ts +6 -2
- package/src/astro/routes/api/admin/themes/marketplace/index.ts +1 -1
- package/src/astro/routes/api/admin/transfer/[...path].ts +143 -0
- package/src/astro/routes/api/admin/transfer/approvals/[id]/approve.ts +35 -0
- package/src/astro/routes/api/admin/transfer/approvals/[id]/deny.ts +35 -0
- package/src/astro/routes/api/admin/transfer/approvals/index.ts +33 -0
- package/src/astro/routes/api/admin/transfer/capabilities.ts +36 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/advance.ts +34 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/archive.ts +35 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/files/[...path].ts +40 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/index.ts +25 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/manifest.ts +38 -0
- package/src/astro/routes/api/admin/transfer/exports/index.ts +64 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/abandon.ts +28 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/advance.ts +37 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/analyze.ts +51 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/cancel.ts +27 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/execute.ts +48 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/files/[...path].ts +54 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/index.ts +25 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/missing.ts +34 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/plan.ts +29 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/receipt.ts +25 -0
- package/src/astro/routes/api/admin/transfer/imports/index.ts +85 -0
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +11 -3
- package/src/astro/routes/api/auth/dev-bypass.ts +0 -4
- package/src/astro/routes/api/auth/invite/complete.ts +10 -5
- package/src/astro/routes/api/auth/invite/index.ts +17 -3
- package/src/astro/routes/api/auth/invite/register-options.ts +8 -1
- package/src/astro/routes/api/auth/magic-link/send.ts +11 -3
- package/src/astro/routes/api/auth/magic-link/verify.ts +40 -39
- package/src/astro/routes/api/auth/me.ts +34 -11
- package/src/astro/routes/api/auth/mode.ts +6 -14
- package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +30 -9
- package/src/astro/routes/api/auth/oauth/[provider].ts +24 -7
- package/src/astro/routes/api/auth/passkey/options.ts +2 -21
- package/src/astro/routes/api/auth/passkey/register/verify.ts +6 -1
- package/src/astro/routes/api/auth/passkey/verify.ts +10 -5
- package/src/astro/routes/api/auth/signup/complete.ts +10 -5
- package/src/astro/routes/api/auth/signup/request.ts +2 -2
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +4 -246
- package/src/astro/routes/api/comments/[collection]/[contentId]/reactions.ts +97 -0
- package/src/astro/routes/api/content/[collection]/[id]/compare.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +26 -6
- package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +5 -6
- package/src/astro/routes/api/content/[collection]/[id]/lock.ts +133 -0
- package/src/astro/routes/api/content/[collection]/[id]/permanent.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/plugin-extensions/[pluginId]/[kind]/[extensionId].ts +29 -0
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +87 -15
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +58 -8
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/children.ts +52 -0
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/parents.ts +47 -0
- package/src/astro/routes/api/content/[collection]/[id]/restore.ts +6 -4
- package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +6 -6
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +42 -9
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +103 -38
- package/src/astro/routes/api/content/[collection]/[id]/translations.ts +4 -5
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +26 -6
- package/src/astro/routes/api/content/[collection]/[id].ts +62 -18
- package/src/astro/routes/api/content/[collection]/authors.ts +33 -0
- package/src/astro/routes/api/content/[collection]/index.ts +10 -9
- package/src/astro/routes/api/content/[collection]/trash.ts +2 -3
- package/src/astro/routes/api/health.ts +18 -0
- package/src/astro/routes/api/import/wordpress/execute.ts +428 -8
- package/src/astro/routes/api/import/wordpress/media.ts +9 -3
- package/src/astro/routes/api/import/wordpress/prepare.ts +10 -12
- package/src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts +225 -0
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +132 -273
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +798 -46
- package/src/astro/routes/api/manifest.ts +85 -46
- package/src/astro/routes/api/mcp.ts +6 -2
- package/src/astro/routes/api/media/[id]/confirm.ts +169 -11
- package/src/astro/routes/api/media/[id]/replace.ts +114 -0
- package/src/astro/routes/api/media/[id]/upload.ts +262 -0
- package/src/astro/routes/api/media/[id]/usage.ts +30 -0
- package/src/astro/routes/api/media/[id].ts +32 -18
- package/src/astro/routes/api/media/asset/[id]/[filename].ts +50 -0
- package/src/astro/routes/api/media/file/[...key].ts +37 -1
- package/src/astro/routes/api/media/folders/[id].ts +55 -0
- package/src/astro/routes/api/media/folders/index.ts +37 -0
- package/src/astro/routes/api/media/providers/[providerId]/index.ts +12 -3
- package/src/astro/routes/api/media/upload-url.ts +44 -37
- package/src/astro/routes/api/media.ts +115 -33
- package/src/astro/routes/api/menus/[name]/items/[id].ts +74 -0
- package/src/astro/routes/api/menus/[name]/items.ts +12 -60
- package/src/astro/routes/api/menus/[name]/reorder.ts +12 -4
- package/src/astro/routes/api/menus/[name]/translations.ts +85 -0
- package/src/astro/routes/api/menus/[name].ts +25 -11
- package/src/astro/routes/api/menus/index.ts +13 -7
- package/src/astro/routes/api/oauth/authorize.ts +47 -15
- package/src/astro/routes/api/oauth/device/authorize.ts +33 -4
- package/src/astro/routes/api/oauth/register.ts +22 -2
- package/src/astro/routes/api/openapi.json.ts +27 -10
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +13 -59
- package/src/astro/routes/api/redirects/404s/index.ts +7 -1
- package/src/astro/routes/api/redirects/404s/summary.ts +3 -1
- package/src/astro/routes/api/redirects/[id].ts +7 -4
- package/src/astro/routes/api/redirects/index.ts +5 -3
- package/src/astro/routes/api/relations/[id]/index.ts +84 -0
- package/src/astro/routes/api/relations/index.ts +56 -0
- package/src/astro/routes/api/revisions/[revisionId]/index.ts +1 -1
- package/src/astro/routes/api/revisions/[revisionId]/restore.ts +17 -1
- package/src/astro/routes/api/schema/block-types/[slug]/index.ts +29 -0
- package/src/astro/routes/api/schema/block-types/[slug]/versions/[version]/activate.ts +31 -0
- package/src/astro/routes/api/schema/block-types/index.ts +29 -0
- package/src/astro/routes/api/schema/collections/[slug]/fields/[fieldSlug].ts +9 -13
- package/src/astro/routes/api/schema/collections/[slug]/fields/index.ts +2 -8
- package/src/astro/routes/api/schema/collections/[slug]/fields/reorder.ts +1 -2
- package/src/astro/routes/api/schema/collections/[slug]/index.ts +5 -11
- package/src/astro/routes/api/schema/collections/index.ts +4 -4
- package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
- package/src/astro/routes/api/schema/index.ts +19 -19
- package/src/astro/routes/api/schema/orphans/[slug].ts +1 -1
- package/src/astro/routes/api/schema/orphans/index.ts +1 -1
- package/src/astro/routes/api/search/enable.ts +5 -1
- package/src/astro/routes/api/search/index.ts +13 -2
- package/src/astro/routes/api/search/rebuild.ts +6 -1
- package/src/astro/routes/api/sections/[slug].ts +7 -1
- package/src/astro/routes/api/sections/index.ts +5 -1
- 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/settings/email.ts +1 -1
- package/src/astro/routes/api/settings.ts +4 -1
- package/src/astro/routes/api/setup/admin-verify.ts +20 -10
- package/src/astro/routes/api/setup/admin.ts +11 -4
- package/src/astro/routes/api/setup/dev-bypass.ts +26 -10
- package/src/astro/routes/api/setup/index.ts +71 -36
- package/src/astro/routes/api/snapshot.ts +48 -19
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +44 -0
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +92 -0
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +28 -23
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +19 -15
- package/src/astro/routes/api/taxonomies/[name]/translations.ts +48 -0
- package/src/astro/routes/api/taxonomies/[name].ts +107 -0
- package/src/astro/routes/api/taxonomies/bulk-tag.ts +29 -0
- package/src/astro/routes/api/taxonomies/index.ts +13 -8
- package/src/astro/routes/api/themes/preview.ts +11 -5
- package/src/astro/routes/api/typegen.ts +4 -42
- package/src/astro/routes/api/visual-editing/action-token.ts +36 -0
- package/src/astro/routes/api/visual-editing/content/[collection]/[id]/publish.ts +32 -0
- package/src/astro/routes/api/visual-editing/toolbar-labels.ts +16 -0
- 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/routes/api/widget-areas/[name]/reorder.ts +3 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +5 -2
- package/src/astro/routes/api/widget-areas/[name]/widgets.ts +3 -1
- package/src/astro/routes/api/widget-areas/[name].ts +3 -1
- package/src/astro/routes/api/widget-areas/index.ts +3 -1
- package/src/astro/routes/sitemap-[collection].xml.ts +133 -14
- package/src/astro/session-user.ts +71 -0
- package/src/astro/types.ts +304 -16
- package/src/auth/allowed-origins.ts +168 -0
- package/src/auth/api-tokens.ts +2 -0
- package/src/auth/challenge-store.ts +3 -1
- package/src/auth/oauth-state-store.ts +3 -0
- package/src/auth/passkey-config.ts +35 -13
- package/src/auth/providers/github-admin.tsx +5 -6
- package/src/auth/providers/google-admin.tsx +5 -6
- package/src/auth/rate-limit.ts +6 -5
- package/src/auth/scopes.ts +14 -9
- package/src/auth/trusted-proxy.ts +1 -1
- package/src/aws-sdk.d.ts +1 -0
- package/src/bylines/credits.ts +149 -0
- package/src/bylines/field-defs-cache.ts +188 -0
- package/src/bylines/index.ts +152 -152
- package/src/cache/chrome-tags.ts +24 -0
- package/src/cleanup.ts +72 -26
- package/src/cli/client-factory.ts +6 -2
- package/src/cli/commands/content.ts +48 -7
- package/src/cli/commands/doctor.ts +219 -7
- package/src/cli/commands/export-seed.ts +1021 -142
- package/src/cli/commands/init.ts +4 -8
- package/src/cli/commands/login.ts +8 -1
- package/src/cli/commands/media.ts +127 -0
- package/src/cli/commands/migrate.ts +641 -0
- package/src/cli/commands/secrets.ts +183 -0
- package/src/cli/commands/seed.ts +9 -3
- package/src/cli/commands/site.ts +556 -0
- package/src/cli/credentials.ts +2 -61
- package/src/cli/index.ts +6 -28
- package/src/cli/site/archive.ts +273 -0
- package/src/cli/site/export.ts +311 -0
- package/src/cli/site/import.ts +815 -0
- package/src/cli/site/shared.ts +241 -0
- package/src/cli/wxr/parser.ts +263 -0
- package/src/client/index.ts +849 -31
- package/src/client/portable-text.ts +41 -0
- package/src/client/transport.ts +23 -9
- package/src/comments/public-submission.ts +254 -0
- package/src/comments/query.ts +78 -7
- package/src/comments/ranking.ts +58 -0
- package/src/comments/service.ts +60 -13
- package/src/comments/turnstile.ts +64 -0
- package/src/components/Block.astro +83 -0
- package/src/components/BlockquoteGroup.astro +34 -0
- package/src/components/Blocks.astro +46 -0
- package/src/components/Break.astro +2 -2
- package/src/components/Columns.astro +3 -1
- package/src/components/CommentForm.astro +13 -6
- package/src/components/Comments.astro +137 -2
- package/src/components/Cover.astro +3 -1
- package/src/components/EmDashBodyEnd.astro +4 -1
- package/src/components/EmDashBodyStart.astro +4 -1
- package/src/components/EmDashHead.astro +113 -25
- package/src/components/EmDashImage.astro +210 -53
- package/src/components/EmDashMedia.astro +3 -3
- package/src/components/Embed.astro +1 -1
- package/src/components/Gallery.astro +166 -29
- package/src/components/Image.astro +158 -40
- package/src/components/InlineEditor.astro +3 -1
- package/src/components/InlinePortableTextEditor.tsx +854 -97
- package/src/components/JsonLdScript.astro +9 -0
- package/src/components/LiveSearch.astro +63 -4
- package/src/components/OrderedList.astro +14 -0
- package/src/components/PortableText.astro +34 -2
- package/src/components/Table.astro +147 -62
- package/src/components/WidgetArea.astro +3 -2
- package/src/components/blocks.ts +44 -0
- package/src/components/code-mark.ts +11 -0
- package/src/components/index.ts +25 -8
- package/src/components/inline-code-block.tsx +474 -0
- package/src/components/live-search-routing.ts +30 -0
- package/src/components/marks/Link.astro +5 -1
- package/src/components/ordered-list.ts +549 -0
- package/src/components/portable-text-blockquote-group.ts +68 -0
- package/src/components/portable-text-text-align.ts +38 -0
- package/src/components/widgets/Archives.astro +7 -41
- package/src/components/widgets/Categories.astro +1 -1
- package/src/components/widgets/Tags.astro +1 -1
- package/src/config/errors.ts +13 -0
- package/src/config/secrets.ts +562 -0
- package/src/content/converters/gallery.ts +101 -0
- package/src/content/converters/image-link.ts +27 -0
- package/src/content/converters/index.ts +3 -0
- package/src/content/converters/mark-safety.ts +121 -0
- package/src/content/converters/numbered-list.ts +148 -0
- package/src/content/converters/portable-text-identity.ts +139 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +400 -90
- package/src/content/converters/prosemirror-to-portable-text.ts +234 -46
- package/src/content/converters/types.ts +80 -0
- package/src/content/known-fields.ts +44 -0
- package/src/content/portable-text-lists.ts +205 -0
- package/src/content-list-query.ts +29 -0
- package/src/database/connection.ts +9 -41
- package/src/database/content-datetime.ts +228 -0
- package/src/database/datetime-storage.ts +452 -0
- package/src/database/dialect-helpers.ts +352 -10
- package/src/database/errors.ts +14 -0
- package/src/database/index.ts +11 -3
- package/src/database/instrumentation.ts +56 -9
- package/src/database/json-recordset.ts +16 -0
- package/src/database/migration-lock.ts +140 -0
- package/src/database/migrations/006_taxonomy_defs.ts +1 -1
- package/src/database/migrations/014_draft_revisions.ts +6 -6
- package/src/database/migrations/016_api_tokens.ts +18 -3
- package/src/database/migrations/017_authorization_codes.ts +14 -4
- package/src/database/migrations/019_i18n.ts +3 -3
- package/src/database/migrations/034_published_at_index.ts +1 -1
- package/src/database/migrations/035_bounded_404_log.ts +37 -31
- package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +655 -0
- package/src/database/migrations/037_credential_algorithm.ts +18 -0
- package/src/database/migrations/038_registry_plugin_state.ts +130 -0
- package/src/database/migrations/039_fix_fts5_triggers.ts +264 -0
- package/src/database/migrations/040_byline_i18n.ts +497 -0
- package/src/database/migrations/041_content_locale_list_index.ts +47 -0
- package/src/database/migrations/042_byline_fields.ts +157 -0
- package/src/database/migrations/043_content_references.ts +121 -0
- package/src/database/migrations/044_comment_reactions.ts +56 -0
- package/src/database/migrations/045_taxonomy_parent_group.ts +68 -0
- package/src/database/migrations/046_media_usage_index.ts +115 -0
- package/src/database/migrations/047_restore_taxonomy_parent_index.ts +29 -0
- package/src/database/migrations/048_restore_content_taxonomies_term_index.ts +32 -0
- package/src/database/migrations/049_taxonomies_name_locale_index.ts +42 -0
- package/src/database/migrations/050_media_usage_index_status.ts +142 -0
- 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/054_media_upload_attempts.ts +41 -0
- package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
- package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
- package/src/database/migrations/057_collection_hidden.ts +24 -0
- package/src/database/migrations/058_collection_sort_order.ts +20 -0
- package/src/database/migrations/059_revision_prune_queue.ts +36 -0
- package/src/database/migrations/060_collection_admin_config.ts +16 -0
- package/src/database/migrations/061_media_usage_cleanup.ts +77 -0
- package/src/database/migrations/062_media_usage_cleanup_fence.ts +295 -0
- package/src/database/migrations/063_media_usage_incremental_work.ts +397 -0
- package/src/database/migrations/064_fts_plain_text.ts +253 -0
- package/src/database/migrations/065_media_usage_collection_deletion.ts +85 -0
- package/src/database/migrations/066_media_usage_reconciliation.ts +115 -0
- package/src/database/migrations/067_indexed_content_fields.ts +39 -0
- package/src/database/migrations/068_content_taxonomy_entry_groups.ts +61 -0
- package/src/database/migrations/069_collection_title_date_fields.ts +45 -0
- package/src/database/migrations/070_collection_routable.ts +18 -0
- package/src/database/migrations/071_restore_content_bylines_table.ts +43 -0
- package/src/database/migrations/072_media_folders.ts +72 -0
- package/src/database/migrations/073_media_focal_point.ts +57 -0
- package/src/database/migrations/074_content_deleted_scheduled_index.ts +55 -0
- package/src/database/migrations/075_entry_edit_locks.ts +44 -0
- package/src/database/migrations/076_collection_nav_group.ts +22 -0
- package/src/database/migrations/077_plugin_storage_revisions.ts +89 -0
- package/src/database/migrations/078_menu_item_translation_groups.ts +15 -0
- package/src/database/migrations/079_datetime_normalization.ts +13 -0
- package/src/database/migrations/080_content_translation_locale_unique.ts +88 -0
- package/src/database/migrations/081_redirect_write_guards.ts +260 -0
- package/src/database/migrations/082_taxonomy_translation_locale_unique.ts +49 -0
- package/src/database/migrations/083_block_types.ts +58 -0
- package/src/database/migrations/084_site_transfer.ts +264 -0
- package/src/database/migrations/085_taxonomy_def_groups.ts +155 -0
- package/src/database/migrations/086_relations_structural.ts +197 -0
- package/src/database/migrations/087_reference_field_relations.ts +407 -0
- package/src/database/migrations/088_cron_oneshot_utc.ts +39 -0
- package/src/database/migrations/089_auto_seed_completion.ts +13 -0
- package/src/database/migrations/policy.ts +70 -0
- package/src/database/migrations/runner.ts +416 -43
- package/src/database/pg-migration-lock.ts +69 -0
- package/src/database/reference-backfill.ts +141 -0
- package/src/database/repositories/audit.ts +13 -3
- package/src/database/repositories/byline.ts +1120 -87
- package/src/database/repositories/comment-reaction.ts +132 -0
- package/src/database/repositories/comment.ts +99 -3
- package/src/database/repositories/content.ts +2210 -267
- package/src/database/repositories/entry-locks.ts +257 -0
- package/src/database/repositories/index.ts +21 -0
- package/src/database/repositories/media-folders.ts +115 -0
- package/src/database/repositories/media-usage-work.ts +1132 -0
- package/src/database/repositories/media-usage.ts +4040 -0
- package/src/database/repositories/media.ts +465 -55
- package/src/database/repositories/menu.ts +657 -0
- package/src/database/repositories/options.ts +128 -10
- package/src/database/repositories/plugin-storage.ts +265 -44
- package/src/database/repositories/redirect.ts +296 -79
- package/src/database/repositories/relation.ts +1004 -0
- package/src/database/repositories/revision.ts +225 -31
- package/src/database/repositories/seo.ts +3 -0
- package/src/database/repositories/taxonomy-def.ts +126 -0
- package/src/database/repositories/taxonomy.ts +747 -97
- package/src/database/repositories/types.ts +209 -0
- package/src/database/repositories/user.ts +18 -0
- package/src/database/transaction.ts +12 -0
- package/src/database/types.ts +525 -7
- package/src/database/validate.ts +39 -0
- package/src/datetime-normalization.ts +311 -0
- package/src/db/adapters.ts +105 -5
- package/src/db/index.ts +6 -1
- package/src/db/libsql-migrations.ts +72 -0
- package/src/db/libsql.ts +1 -3
- package/src/db/node-sqlite-compat.ts +105 -0
- package/src/db/postgres-migrations.ts +59 -0
- package/src/db/postgres.ts +28 -2
- package/src/db/sqlite-migrations.ts +37 -0
- package/src/db/sqlite.ts +4 -7
- package/src/deferred-tasks.ts +71 -0
- package/src/emdash-runtime.ts +4558 -909
- package/src/fields/boolean.ts +1 -1
- package/src/fields/datetime.ts +1 -1
- package/src/fields/file.ts +15 -11
- package/src/fields/image.ts +29 -13
- package/src/fields/integer.ts +1 -1
- package/src/fields/json.ts +1 -1
- package/src/fields/multiselect.ts +1 -1
- package/src/fields/number.ts +1 -1
- package/src/fields/portable-text.ts +1 -1
- package/src/fields/richtext.ts +1 -1
- package/src/fields/select.ts +1 -1
- package/src/fields/slug.ts +1 -1
- package/src/fields/text.ts +1 -1
- package/src/fields/textarea.ts +1 -1
- package/src/fields/types.ts +29 -9
- package/src/i18n/config.ts +57 -10
- package/src/i18n/normalize.ts +31 -0
- package/src/i18n/repair-locale-casing.ts +37 -0
- package/src/i18n/resolve.ts +272 -0
- package/src/i18n/taxonomy-locale-diagnostic.ts +47 -0
- package/src/import/comments.ts +159 -0
- package/src/import/index.ts +8 -1
- package/src/import/settings.ts +65 -189
- package/src/import/sources/wordpress-plugin.ts +347 -44
- package/src/import/sources/wxr.ts +20 -3
- package/src/import/ssrf.ts +20 -500
- package/src/import/types.ts +12 -0
- package/src/import/utils.ts +214 -0
- package/src/import/wxr-taxonomies.ts +748 -0
- package/src/index.ts +274 -20
- package/src/loader.ts +1257 -152
- package/src/mcp/server.ts +2065 -272
- package/src/mcp/transfer.ts +569 -0
- package/src/media/enrich.ts +78 -0
- package/src/media/focal-point.ts +37 -0
- package/src/media/image-endpoint.ts +206 -0
- package/src/media/index.ts +1 -0
- package/src/media/local-runtime.ts +49 -15
- package/src/media/local.ts +1 -1
- package/src/media/mime.ts +76 -0
- package/src/media/normalize.ts +82 -9
- package/src/media/placeholder.ts +29 -9
- package/src/media/responsive.ts +148 -0
- package/src/media/types.ts +24 -0
- package/src/media/upload-attempts.ts +38 -0
- package/src/media/url.ts +15 -0
- package/src/media/usage/activation.ts +762 -0
- package/src/media/usage/capture-triggers.ts +559 -0
- package/src/media/usage/cleanup.ts +306 -0
- package/src/media/usage/collection-deletion-processor.ts +360 -0
- package/src/media/usage/collection-deletion.ts +846 -0
- package/src/media/usage/content-fields.ts +220 -0
- package/src/media/usage/content-refresh.ts +1000 -0
- package/src/media/usage/content-repair.ts +802 -0
- package/src/media/usage/content-snapshots.ts +516 -0
- package/src/media/usage/extractor.ts +427 -0
- package/src/media/usage/gc.ts +50 -0
- package/src/media/usage/maintenance-engine.ts +166 -0
- package/src/media/usage/projection-fingerprint.ts +143 -0
- package/src/media/usage/reconciliation-processor.ts +449 -0
- package/src/media/usage/reconciliation.ts +1200 -0
- package/src/media/usage/schema-invalidation.ts +72 -0
- package/src/media/usage/site-settings.ts +52 -0
- package/src/media/usage/source-key.ts +26 -0
- package/src/media/usage/types.ts +50 -0
- package/src/media/usage/work-processor.ts +489 -0
- package/src/menus/index.ts +408 -198
- package/src/menus/types.ts +15 -1
- package/src/migrations/config-loader.ts +210 -0
- package/src/migrations/direct-executor.ts +179 -0
- package/src/migrations/identity.ts +46 -0
- package/src/migrations/index.ts +20 -0
- package/src/migrations/integration-metadata.ts +67 -0
- package/src/migrations/manifest-builder.ts +55 -0
- package/src/migrations/manifest-writer.ts +63 -0
- package/src/migrations/manifest.ts +197 -0
- package/src/migrations/protocol.ts +69 -0
- package/src/migrations/target.ts +35 -0
- package/src/object-cache/codec.ts +73 -0
- package/src/object-cache/index.ts +852 -0
- package/src/object-cache/memory.ts +91 -0
- package/src/object-cache/types.ts +125 -0
- package/src/page/absolute-url.ts +146 -0
- package/src/page/jsonld.ts +10 -2
- package/src/page/metadata.ts +50 -3
- package/src/page/seo-contributions.ts +94 -6
- package/src/page/seo-panel.ts +47 -0
- package/src/page/site-identity.ts +58 -0
- package/src/plugin-test-runtime.ts +18 -0
- package/src/plugin-types.ts +410 -0
- package/src/plugin-utils.ts +31 -6
- package/src/plugins/adapt-sandbox-entry.ts +249 -56
- package/src/plugins/byline-access.ts +158 -0
- package/src/plugins/conditional-storage.ts +30 -0
- package/src/plugins/content-access.ts +170 -0
- package/src/plugins/content-policy.ts +74 -0
- package/src/plugins/context.ts +1160 -251
- package/src/plugins/cron.ts +69 -19
- package/src/plugins/define-plugin.ts +129 -86
- package/src/plugins/editor-draft.ts +257 -0
- package/src/plugins/email-console.ts +3 -1
- package/src/plugins/email.ts +16 -0
- package/src/plugins/hooks.ts +330 -57
- package/src/plugins/host.ts +30 -0
- package/src/plugins/http-route-dispatch.ts +389 -0
- package/src/plugins/http-wire.ts +180 -0
- package/src/plugins/index.ts +148 -12
- package/src/plugins/install-finalization.ts +77 -0
- package/src/plugins/lifecycle.ts +47 -0
- package/src/plugins/manager.ts +40 -2
- package/src/plugins/manifest-schema.ts +452 -49
- package/src/plugins/marketplace.ts +110 -42
- package/src/plugins/media.ts +166 -0
- package/src/plugins/request-meta.ts +12 -2
- package/src/plugins/route-error.ts +57 -0
- package/src/plugins/route-wire.ts +304 -0
- package/src/plugins/routes.ts +183 -62
- package/src/plugins/sandbox/hook-result.ts +52 -0
- package/src/plugins/sandbox/index.ts +25 -1
- package/src/plugins/sandbox/noop.ts +13 -5
- package/src/plugins/sandbox/proxy.ts +130 -0
- package/src/plugins/sandbox/runner-options.ts +16 -0
- package/src/plugins/sandbox/types.ts +218 -9
- package/src/plugins/save-rejection.ts +20 -0
- package/src/plugins/scheduler/node.ts +9 -2
- package/src/plugins/secret-redactor.ts +65 -0
- package/src/plugins/settings.ts +303 -0
- package/src/plugins/state.ts +137 -39
- package/src/plugins/storage-indexes.ts +50 -11
- package/src/plugins/storage-query.ts +111 -32
- package/src/plugins/storage-update.ts +96 -0
- package/src/plugins/types.ts +1014 -152
- package/src/preview/urls.ts +23 -3
- package/src/query.ts +1188 -85
- package/src/redirects/cache.ts +113 -23
- package/src/redirects/destination.ts +20 -0
- package/src/redirects/loops.ts +10 -6
- package/src/redirects/patterns.ts +12 -30
- package/src/redirects/status.ts +27 -0
- package/src/references/field-map.ts +115 -0
- package/src/references/resolve.ts +160 -0
- package/src/references/staged.ts +157 -0
- package/src/references/types.ts +16 -0
- package/src/registry/artifact-checksum.ts +15 -0
- package/src/registry/artifact-fetch.ts +317 -0
- package/src/registry/artifact-verification.ts +85 -0
- package/src/registry/authoritative-records.ts +206 -0
- package/src/registry/config.ts +461 -0
- package/src/registry/plugin-id.ts +116 -0
- package/src/registry/publisher-handle.ts +273 -0
- package/src/registry/record-labels.ts +28 -0
- package/src/registry/testing.ts +145 -0
- package/src/registry/types.ts +126 -0
- package/src/request-cache.ts +31 -4
- package/src/request-context.ts +62 -3
- package/src/scheduled-publish.ts +225 -0
- package/src/scheduler-health.ts +46 -0
- package/src/schema/block-type-contract.ts +478 -0
- package/src/schema/block-type-registry.ts +689 -0
- package/src/schema/block-types.ts +110 -0
- package/src/schema/block-values.ts +293 -0
- package/src/schema/byline-registry.ts +671 -0
- package/src/schema/collection-slugs-cache.ts +157 -0
- package/src/schema/env-types.ts +37 -0
- package/src/schema/index.ts +29 -0
- package/src/schema/project-env-types.ts +41 -0
- package/src/schema/query.ts +11 -4
- package/src/schema/registry.ts +1837 -264
- package/src/schema/types.ts +326 -5
- package/src/schema/url-pattern.ts +43 -0
- package/src/schema/zod-generator.ts +357 -34
- package/src/search/fts-manager.ts +256 -39
- package/src/search/index.ts +2 -0
- package/src/search/match.ts +50 -0
- package/src/search/query.ts +155 -18
- package/src/search/types.ts +18 -0
- package/src/security/ssrf.ts +549 -0
- package/src/seed/apply.ts +1547 -274
- package/src/seed/ownership.ts +15 -0
- package/src/seed/types.ts +145 -11
- package/src/seed/validate.ts +415 -26
- package/src/seo/hreflang.ts +196 -0
- package/src/seo/index.ts +28 -32
- package/src/seo/media-url.ts +58 -0
- package/src/settings/index.ts +206 -27
- package/src/settings/types.ts +42 -1
- package/src/storage/local.ts +2 -1
- package/src/storage/s3.ts +6 -4
- package/src/storage/types.ts +8 -0
- package/src/taxonomies/index.ts +686 -302
- package/src/taxonomies/term-counts.ts +175 -0
- package/src/taxonomies/types.ts +10 -0
- package/src/transfer/analyze/index.ts +45 -0
- package/src/transfer/analyze/issues.ts +55 -0
- package/src/transfer/analyze/plan.ts +327 -0
- package/src/transfer/analyze/read.ts +134 -0
- package/src/transfer/analyze/step.ts +551 -0
- package/src/transfer/analyze/target.ts +269 -0
- package/src/transfer/analyze/unique-keys.ts +219 -0
- package/src/transfer/analyze/validate.ts +1550 -0
- package/src/transfer/analyze/values.ts +341 -0
- package/src/transfer/analyze/write-rules.ts +204 -0
- package/src/transfer/audit.ts +38 -0
- package/src/transfer/auth.ts +25 -0
- package/src/transfer/container/tar.ts +242 -0
- package/src/transfer/domain.ts +248 -0
- package/src/transfer/errors.ts +134 -0
- package/src/transfer/export/exporter.ts +1067 -0
- package/src/transfer/export/fence.ts +84 -0
- package/src/transfer/export/media.ts +165 -0
- package/src/transfer/export/readers.ts +1168 -0
- package/src/transfer/export/verify.ts +677 -0
- package/src/transfer/fence.ts +193 -0
- package/src/transfer/format/canonical.ts +151 -0
- package/src/transfer/format/column-codec.ts +275 -0
- package/src/transfer/format/columns.ts +727 -0
- package/src/transfer/format/digest.ts +287 -0
- package/src/transfer/format/features.ts +91 -0
- package/src/transfer/format/issues.ts +39 -0
- package/src/transfer/format/kinds.ts +952 -0
- package/src/transfer/format/limits.ts +87 -0
- package/src/transfer/format/manifest.ts +297 -0
- package/src/transfer/format/media-refs.ts +716 -0
- package/src/transfer/format/paths.ts +73 -0
- package/src/transfer/format/plan.ts +162 -0
- package/src/transfer/format/receipt.ts +43 -0
- package/src/transfer/format/records.ts +127 -0
- package/src/transfer/format/settings.ts +94 -0
- package/src/transfer/format/transformations.ts +260 -0
- package/src/transfer/format/version.ts +9 -0
- package/src/transfer/gc.ts +103 -0
- package/src/transfer/import/advance.ts +522 -0
- package/src/transfer/import/context.ts +288 -0
- package/src/transfer/import/entries.ts +186 -0
- package/src/transfer/import/ids.ts +40 -0
- package/src/transfer/import/index.ts +15 -0
- package/src/transfer/import/media.ts +141 -0
- package/src/transfer/import/rebuild.ts +300 -0
- package/src/transfer/import/rows.ts +114 -0
- package/src/transfer/import/scaffold.ts +221 -0
- package/src/transfer/import/sql.ts +134 -0
- package/src/transfer/import/stages.ts +329 -0
- package/src/transfer/import/writers.ts +370 -0
- package/src/transfer/index.ts +472 -0
- package/src/transfer/ops/approvals.ts +359 -0
- package/src/transfer/ops/budget.ts +82 -0
- package/src/transfer/ops/collation.ts +21 -0
- package/src/transfer/ops/identity-map.ts +142 -0
- package/src/transfer/ops/media-blobs.ts +135 -0
- package/src/transfer/ops/operations.ts +842 -0
- package/src/transfer/ops/package-index.ts +159 -0
- package/src/transfer/ops/staged-files.ts +231 -0
- package/src/transfer/ops/states.ts +265 -0
- package/src/transfer/ops/time.ts +54 -0
- package/src/transfer/schema-importer.ts +34 -0
- package/src/transfer/site-id.ts +30 -0
- package/src/transfer/staging/assembler.ts +217 -0
- package/src/transfer/staging/keys.ts +94 -0
- package/src/transfer/staging/package.ts +229 -0
- package/src/transfer/staging/stage.ts +231 -0
- package/src/ui-comments.ts +19 -0
- package/src/ui.ts +26 -3
- package/src/utils/base64.ts +7 -2
- package/src/utils/db-errors.ts +26 -0
- package/src/utils/hash.ts +14 -3
- package/src/utils/init-lock.ts +143 -0
- package/src/utils/single-flight-cache.ts +194 -0
- package/src/utils/slugify.ts +1 -29
- package/src/utils/url.ts +58 -3
- package/src/virtual-modules.d.ts +84 -0
- package/src/visual-editing/action-token.ts +31 -0
- package/src/visual-editing/editable.ts +41 -35
- package/src/visual-editing/toolbar-bootstrap.ts +145 -0
- package/src/visual-editing/toolbar.ts +273 -48
- package/src/widgets/archives.ts +68 -0
- package/src/widgets/index.ts +83 -54
- package/dist/adapters-BKSf3T9R.d.mts +0 -121
- package/dist/adapters-BKSf3T9R.d.mts.map +0 -1
- package/dist/apply-x0eMK1lX.mjs +0 -1528
- package/dist/apply-x0eMK1lX.mjs.map +0 -1
- package/dist/base64-MBPo9ozB.mjs +0 -59
- package/dist/base64-MBPo9ozB.mjs.map +0 -1
- package/dist/byline-Chbr2GoP.mjs +0 -220
- package/dist/byline-Chbr2GoP.mjs.map +0 -1
- package/dist/bylines-CRNsVG88.mjs +0 -157
- package/dist/bylines-CRNsVG88.mjs.map +0 -1
- package/dist/cache-BkKBuIvS.mjs +0 -56
- package/dist/cache-BkKBuIvS.mjs.map +0 -1
- package/dist/chunk-ClPoSABd.mjs +0 -21
- package/dist/chunks-HGz06Soa.mjs +0 -19
- package/dist/chunks-HGz06Soa.mjs.map +0 -1
- package/dist/config-BXwuX8Bx.mjs +0 -47
- package/dist/config-BXwuX8Bx.mjs.map +0 -1
- package/dist/connection-2igzM-AT.mjs +0 -57
- package/dist/connection-2igzM-AT.mjs.map +0 -1
- package/dist/content-BcQPYxdV.mjs +0 -878
- package/dist/content-BcQPYxdV.mjs.map +0 -1
- package/dist/db-errors-l1Qh2RPR.mjs +0 -41
- package/dist/db-errors-l1Qh2RPR.mjs.map +0 -1
- package/dist/default-DCVqE5ib.mjs +0 -81
- package/dist/default-DCVqE5ib.mjs.map +0 -1
- package/dist/dialect-helpers-DhTzaUxP.mjs +0 -93
- package/dist/dialect-helpers-DhTzaUxP.mjs.map +0 -1
- package/dist/error-zG5T1UGA.mjs +0 -27
- package/dist/error-zG5T1UGA.mjs.map +0 -1
- package/dist/index-DIb-CzNx.d.mts +0 -4955
- package/dist/index-DIb-CzNx.d.mts.map +0 -1
- package/dist/load-CyEoextb.mjs +0 -28
- package/dist/load-CyEoextb.mjs.map +0 -1
- package/dist/loader-CndGj8kM.mjs +0 -457
- package/dist/loader-CndGj8kM.mjs.map +0 -1
- package/dist/manifest-schema-DH9xhc6t.mjs +0 -199
- package/dist/manifest-schema-DH9xhc6t.mjs.map +0 -1
- package/dist/media-D8FbNsl0.mjs +0 -197
- package/dist/media-D8FbNsl0.mjs.map +0 -1
- package/dist/mode-BnAOqItE.mjs +0 -23
- package/dist/mode-BnAOqItE.mjs.map +0 -1
- package/dist/patterns-CrCYkMBb.mjs +0 -93
- package/dist/patterns-CrCYkMBb.mjs.map +0 -1
- package/dist/placeholder-C-fk5hYI.mjs +0 -268
- package/dist/placeholder-C-fk5hYI.mjs.map +0 -1
- package/dist/placeholder-D29tWZ7o.d.mts +0 -284
- package/dist/placeholder-D29tWZ7o.d.mts.map +0 -1
- package/dist/query-fqEdLFms.mjs +0 -558
- package/dist/query-fqEdLFms.mjs.map +0 -1
- package/dist/redirect-D_pshWdf.mjs +0 -302
- package/dist/redirect-D_pshWdf.mjs.map +0 -1
- package/dist/registry-C3Mr0ODu.mjs +0 -902
- package/dist/registry-C3Mr0ODu.mjs.map +0 -1
- package/dist/request-cache-Ci7f5pBb.mjs +0 -79
- package/dist/request-cache-Ci7f5pBb.mjs.map +0 -1
- package/dist/runner-OURCaApa.d.mts +0 -34
- package/dist/runner-OURCaApa.d.mts.map +0 -1
- package/dist/runner-tQ7BJ4T7.mjs +0 -1619
- package/dist/runner-tQ7BJ4T7.mjs.map +0 -1
- package/dist/search-BoZYFuUk.mjs +0 -9637
- package/dist/search-BoZYFuUk.mjs.map +0 -1
- package/dist/taxonomies-B4IAshV8.mjs +0 -308
- package/dist/taxonomies-B4IAshV8.mjs.map +0 -1
- package/dist/tokens-D9vnZqYS.mjs +0 -171
- package/dist/tokens-D9vnZqYS.mjs.map +0 -1
- package/dist/transaction-Cn2rjY78.mjs +0 -28
- package/dist/transaction-Cn2rjY78.mjs.map +0 -1
- package/dist/transport-C9ugt2Nr.mjs +0 -418
- package/dist/transport-C9ugt2Nr.mjs.map +0 -1
- package/dist/transport-CUnEL3Vs.d.mts +0 -42
- package/dist/transport-CUnEL3Vs.d.mts.map +0 -1
- package/dist/types-BIgulNsW.mjs +0 -68
- package/dist/types-BIgulNsW.mjs.map +0 -1
- package/dist/types-Bm1dn-q3.mjs +0 -83
- package/dist/types-Bm1dn-q3.mjs.map +0 -1
- package/dist/types-BmPPSUEx.d.mts +0 -243
- package/dist/types-BmPPSUEx.d.mts.map +0 -1
- package/dist/types-BrA0xf5I.d.mts +0 -126
- package/dist/types-BrA0xf5I.d.mts.map +0 -1
- package/dist/types-CS8FIX7L.d.mts +0 -435
- package/dist/types-CS8FIX7L.d.mts.map +0 -1
- package/dist/types-CgqmmMJB.mjs +0 -16
- package/dist/types-CgqmmMJB.mjs.map +0 -1
- package/dist/types-DIMwPFub.d.mts +0 -192
- package/dist/types-DIMwPFub.d.mts.map +0 -1
- package/dist/types-i36XcA_X.d.mts +0 -1252
- package/dist/types-i36XcA_X.d.mts.map +0 -1
- package/dist/validate-CxVsLehf.mjs +0 -328
- package/dist/validate-CxVsLehf.mjs.map +0 -1
- package/dist/validate-DHxmpFJt.d.mts +0 -331
- package/dist/validate-DHxmpFJt.d.mts.map +0 -1
- package/dist/validate-VPnKoIzW.mjs +0 -97
- package/dist/validate-VPnKoIzW.mjs.map +0 -1
- package/dist/validation-C-ZpN2GI.mjs +0 -144
- package/dist/validation-C-ZpN2GI.mjs.map +0 -1
- package/dist/version-DJrV1K0M.mjs +0 -7
- package/dist/version-DJrV1K0M.mjs.map +0 -1
- package/dist/zod-generator-CpwccCIv.mjs +0 -132
- package/dist/zod-generator-CpwccCIv.mjs.map +0 -1
- package/src/cli/commands/auth.ts +0 -46
- package/src/cli/commands/bundle-utils.ts +0 -273
- package/src/cli/commands/bundle.ts +0 -626
- package/src/cli/commands/dev.ts +0 -191
- package/src/cli/commands/plugin-init.ts +0 -291
- package/src/cli/commands/plugin-validate.ts +0 -31
- package/src/cli/commands/plugin.ts +0 -33
- package/src/cli/commands/publish.ts +0 -697
- package/src/plugins/scheduler/piggyback.ts +0 -71
package/src/mcp/server.ts
CHANGED
|
@@ -10,16 +10,137 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import type { Permission, RoleLevel } from "@emdash-cms/auth";
|
|
13
|
-
import { canActOnOwn, hasPermission, Role } from "@emdash-cms/auth";
|
|
13
|
+
import { canActOnOwn, hasPermission, Permissions, Role } from "@emdash-cms/auth";
|
|
14
14
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
15
|
+
import type { APIContext } from "astro";
|
|
15
16
|
import { z } from "zod";
|
|
16
17
|
|
|
18
|
+
import {
|
|
19
|
+
bylineCreateBody,
|
|
20
|
+
bylineUpdateBody,
|
|
21
|
+
CONTENT_TYPE_RE,
|
|
22
|
+
contentBylineInputSchema,
|
|
23
|
+
contentSeoInput,
|
|
24
|
+
createBlockTypeBody,
|
|
25
|
+
createCollectionBody,
|
|
26
|
+
createTaxonomyDefBody,
|
|
27
|
+
updateCollectionBody,
|
|
28
|
+
updateBlockTypeBody,
|
|
29
|
+
updateFieldBody,
|
|
30
|
+
updateTaxonomyDefBody,
|
|
31
|
+
} from "#api/schemas.js";
|
|
32
|
+
|
|
33
|
+
import { after } from "../after.js";
|
|
34
|
+
import { claimEntryLockForWrite } from "../api/handlers/entry-lock.js";
|
|
35
|
+
import type { MediaUsageRepairRequest } from "../api/schemas/media-usage.js";
|
|
17
36
|
import type { EmDashHandlers } from "../astro/types.js";
|
|
18
37
|
import { hasScope } from "../auth/api-tokens.js";
|
|
38
|
+
import { menuTag, siteSettingsTag, taxonomyTag } from "../cache/chrome-tags.js";
|
|
39
|
+
import { convertDataForRead, convertDataForWrite } from "../client/portable-text.js";
|
|
40
|
+
import type { FieldSchema } from "../client/portable-text.js";
|
|
41
|
+
import { decodeCursor, InvalidCursorError } from "../database/repositories/types.js";
|
|
42
|
+
import type { RouteCallerInput } from "../plugins/routes.js";
|
|
43
|
+
import {
|
|
44
|
+
TRANSFER_SCOPES,
|
|
45
|
+
type TransferApprovalAction,
|
|
46
|
+
type TransferScope,
|
|
47
|
+
} from "../transfer/auth.js";
|
|
48
|
+
import { readSiteWriteFence, recordSiteWrite } from "../transfer/fence.js";
|
|
49
|
+
import { toSha256Digest } from "../transfer/format/digest.js";
|
|
50
|
+
import { siteImportDecisionsInputSchema } from "../transfer/format/plan.js";
|
|
51
|
+
import { decodeBase64, encodeBase64 } from "../utils/base64.js";
|
|
52
|
+
import {
|
|
53
|
+
analyzeImport,
|
|
54
|
+
exportStatus,
|
|
55
|
+
hasOperationGrant,
|
|
56
|
+
importReceipt,
|
|
57
|
+
importStatus,
|
|
58
|
+
resumeImport,
|
|
59
|
+
startExport,
|
|
60
|
+
startImport,
|
|
61
|
+
transferCapabilities,
|
|
62
|
+
type TransferContext,
|
|
63
|
+
} from "./transfer.js";
|
|
19
64
|
|
|
20
65
|
const COLLECTION_SLUG_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
21
66
|
/** http(s) scheme matcher used by `settings_update` URL validation. */
|
|
22
67
|
const HTTP_SCHEME_PATTERN = /^https?:\/\//i;
|
|
68
|
+
/**
|
|
69
|
+
* Shared wording for the `_rev` parameter on write tools. Agents only see the
|
|
70
|
+
* tool schema, so the retry protocol is stated here.
|
|
71
|
+
*/
|
|
72
|
+
const REV_PARAM_DESCRIPTION =
|
|
73
|
+
"Revision token proving you have read the current item. Call content_get " +
|
|
74
|
+
"first and pass back the _rev it returns. If this call fails with CONFLICT " +
|
|
75
|
+
"the item changed in the meantime: call content_get again and retry with " +
|
|
76
|
+
"the new token.";
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Replaces Zod's "expected string, received undefined" for a caller that never
|
|
80
|
+
* read the schema, so the message says where the token comes from.
|
|
81
|
+
*/
|
|
82
|
+
const REV_MISSING_ERROR =
|
|
83
|
+
"_rev is required: call content_get for this item and pass back the _rev it returns.";
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Shared wording for the `overrideLock` parameter on write tools. Agents only
|
|
87
|
+
* see the tool schema, and re-reading never clears ENTRY_LOCKED, so when to
|
|
88
|
+
* override is stated here.
|
|
89
|
+
*/
|
|
90
|
+
const OVERRIDE_LOCK_PARAM_DESCRIPTION =
|
|
91
|
+
"Write even though someone else has this item open in the admin. Without it, " +
|
|
92
|
+
"the call fails with ENTRY_LOCKED and the error names who is editing; calling " +
|
|
93
|
+
"content_get again does not clear it. Tell the user who holds the item, and " +
|
|
94
|
+
"set this only if they ask you to write anyway.";
|
|
95
|
+
|
|
96
|
+
const SHA256_DIGEST_PATTERN = /^sha256:[0-9a-f]{64}$/;
|
|
97
|
+
const TRANSFER_OPERATION_ID_PATTERN = /^[0-9A-Za-z_-]{1,64}$/;
|
|
98
|
+
|
|
99
|
+
const transferOperationIdSchema = z
|
|
100
|
+
.string()
|
|
101
|
+
.regex(TRANSFER_OPERATION_ID_PATTERN, "Invalid operation id")
|
|
102
|
+
.describe("Transfer operation id");
|
|
103
|
+
|
|
104
|
+
const transferApprovalIdSchema = z
|
|
105
|
+
.string()
|
|
106
|
+
.min(1)
|
|
107
|
+
.max(64)
|
|
108
|
+
.describe("Approval id from an earlier TRANSFER_APPROVAL_REQUIRED error, once approved");
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The site transfer tools. Like the transfer REST API they are exempt from
|
|
112
|
+
* the site write fence, so an import started over MCP can be driven to
|
|
113
|
+
* completion over MCP.
|
|
114
|
+
*/
|
|
115
|
+
const TRANSFER_TOOL_NAMES: ReadonlySet<string> = new Set([
|
|
116
|
+
"site_transfer_capabilities",
|
|
117
|
+
"site_export_start",
|
|
118
|
+
"site_export_status",
|
|
119
|
+
"site_import_analyze",
|
|
120
|
+
"site_import_start",
|
|
121
|
+
"site_import_status",
|
|
122
|
+
"site_import_resume",
|
|
123
|
+
"site_import_receipt",
|
|
124
|
+
]);
|
|
125
|
+
|
|
126
|
+
const APPROVAL_FLOW_DESCRIPTION =
|
|
127
|
+
"If the token lacks the scope, the first call fails with TRANSFER_APPROVAL_REQUIRED and " +
|
|
128
|
+
"details.approvalId; an admin must approve that request in the EmDash admin " +
|
|
129
|
+
"(Settings → Transfer). Then repeat the call with the same arguments plus approvalId. " +
|
|
130
|
+
"Approvals are single-use, bound to this user, this token, and these exact arguments, " +
|
|
131
|
+
"and expire 15 minutes after they are requested or approved.";
|
|
132
|
+
|
|
133
|
+
const TAXONOMY_CURSOR_VERSION = 2;
|
|
134
|
+
const MAX_TAXONOMY_CURSOR_LENGTH = 2048;
|
|
135
|
+
const contentDateTimeInputSchema = z.iso
|
|
136
|
+
.datetime({ offset: true, message: "must be an ISO 8601 datetime" })
|
|
137
|
+
.or(
|
|
138
|
+
z.iso.datetime({
|
|
139
|
+
offset: true,
|
|
140
|
+
precision: -1,
|
|
141
|
+
message: "must be an ISO 8601 datetime",
|
|
142
|
+
}),
|
|
143
|
+
);
|
|
23
144
|
|
|
24
145
|
// ---------------------------------------------------------------------------
|
|
25
146
|
// Shared schemas — kept in sync with `api/schemas/settings.ts` (which the
|
|
@@ -48,8 +169,9 @@ const settingsSeoSchema = z.object({
|
|
|
48
169
|
.optional()
|
|
49
170
|
.describe("Separator between page title and site title (e.g. ' | ')"),
|
|
50
171
|
defaultOgImage: settingsMediaReferenceSchema
|
|
172
|
+
.nullable()
|
|
51
173
|
.optional()
|
|
52
|
-
.describe("Default Open Graph image when content has none"),
|
|
174
|
+
.describe("Default Open Graph image when content has none; null removes it"),
|
|
53
175
|
robotsTxt: z
|
|
54
176
|
.string()
|
|
55
177
|
.max(5000)
|
|
@@ -67,6 +189,125 @@ const settingsSeoSchema = z.object({
|
|
|
67
189
|
.describe("Bing Webmaster Tools verification token"),
|
|
68
190
|
});
|
|
69
191
|
|
|
192
|
+
const mediaUsageRepairToolSchema = z
|
|
193
|
+
.object({
|
|
194
|
+
scope: z.enum(["collection", "all"]).describe("Repair one collection or all collections"),
|
|
195
|
+
collection: z
|
|
196
|
+
.string()
|
|
197
|
+
.min(1)
|
|
198
|
+
.max(63)
|
|
199
|
+
.regex(COLLECTION_SLUG_PATTERN, "Invalid collection slug")
|
|
200
|
+
.optional()
|
|
201
|
+
.describe("Collection slug; required only when scope is collection"),
|
|
202
|
+
})
|
|
203
|
+
.strict()
|
|
204
|
+
.superRefine((input, ctx) => {
|
|
205
|
+
if (input.scope === "collection" && input.collection === undefined) {
|
|
206
|
+
ctx.addIssue({
|
|
207
|
+
code: "custom",
|
|
208
|
+
path: ["collection"],
|
|
209
|
+
message: "Collection is required when scope is collection",
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
if (input.scope === "all" && input.collection !== undefined) {
|
|
213
|
+
ctx.addIssue({
|
|
214
|
+
code: "custom",
|
|
215
|
+
path: ["collection"],
|
|
216
|
+
message: "Collection must be omitted when scope is all",
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
const schemaUpdateCollectionToolSchema = z.object({
|
|
222
|
+
slug: z
|
|
223
|
+
.string()
|
|
224
|
+
.min(1)
|
|
225
|
+
.max(63)
|
|
226
|
+
.regex(COLLECTION_SLUG_PATTERN, "Invalid collection slug")
|
|
227
|
+
.describe("Collection slug to update; the slug itself cannot be changed"),
|
|
228
|
+
label: updateCollectionBody.shape.label.describe("New plural display name"),
|
|
229
|
+
labelSingular: updateCollectionBody.shape.labelSingular.describe("New singular display name"),
|
|
230
|
+
description: updateCollectionBody.shape.description.describe("New collection description"),
|
|
231
|
+
icon: updateCollectionBody.shape.icon.describe("New admin UI icon name"),
|
|
232
|
+
supports: updateCollectionBody.shape.supports.describe(
|
|
233
|
+
"Complete feature list to enable; omit to preserve the current list",
|
|
234
|
+
),
|
|
235
|
+
urlPattern: updateCollectionBody.shape.urlPattern.describe(
|
|
236
|
+
"New public URL pattern such as /blog/{slug}, with at most one placeholder per path segment; pass null to clear it",
|
|
237
|
+
),
|
|
238
|
+
routable: updateCollectionBody.shape.routable.describe(
|
|
239
|
+
"Whether entries require a slug before they can be published",
|
|
240
|
+
),
|
|
241
|
+
hasSeo: updateCollectionBody.shape.hasSeo.describe(
|
|
242
|
+
"Whether the collection supports SEO metadata",
|
|
243
|
+
),
|
|
244
|
+
group: updateCollectionBody.shape.group.describe(
|
|
245
|
+
"Admin sidebar folder shared with other collections of the same group; pass null to move the collection back inline",
|
|
246
|
+
),
|
|
247
|
+
commentsEnabled: updateCollectionBody.shape.commentsEnabled.describe(
|
|
248
|
+
"Whether comments are enabled for this collection",
|
|
249
|
+
),
|
|
250
|
+
commentsModeration: updateCollectionBody.shape.commentsModeration.describe(
|
|
251
|
+
"Comment moderation policy",
|
|
252
|
+
),
|
|
253
|
+
commentsClosedAfterDays: updateCollectionBody.shape.commentsClosedAfterDays.describe(
|
|
254
|
+
"Close comments after this many days; 0 keeps them open",
|
|
255
|
+
),
|
|
256
|
+
commentsAutoApproveUsers: updateCollectionBody.shape.commentsAutoApproveUsers.describe(
|
|
257
|
+
"Whether comments from authenticated users are automatically approved",
|
|
258
|
+
),
|
|
259
|
+
editLocking: updateCollectionBody.shape.editLocking.describe(
|
|
260
|
+
"Whether opening an entry takes an edit lock that refuses other editors' writes",
|
|
261
|
+
),
|
|
262
|
+
titleField: updateCollectionBody.shape.titleField.describe(
|
|
263
|
+
"Field slug to use as the Title column in admin lists; pass null to fall back to the default",
|
|
264
|
+
),
|
|
265
|
+
dateField: updateCollectionBody.shape.dateField.describe(
|
|
266
|
+
"Datetime field slug to use as the Date column in admin lists; pass null to fall back to the default",
|
|
267
|
+
),
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
const schemaUpdateFieldToolSchema = z.object({
|
|
271
|
+
collection: z
|
|
272
|
+
.string()
|
|
273
|
+
.min(1)
|
|
274
|
+
.max(63)
|
|
275
|
+
.regex(COLLECTION_SLUG_PATTERN, "Invalid collection slug")
|
|
276
|
+
.describe("Collection slug containing the field"),
|
|
277
|
+
fieldSlug: z
|
|
278
|
+
.string()
|
|
279
|
+
.min(1)
|
|
280
|
+
.max(63)
|
|
281
|
+
.regex(COLLECTION_SLUG_PATTERN, "Invalid field slug")
|
|
282
|
+
.describe("Field slug to update; the slug itself cannot be changed"),
|
|
283
|
+
label: updateFieldBody.shape.label.describe("New display name"),
|
|
284
|
+
type: updateFieldBody.shape.type.describe(
|
|
285
|
+
"New field type; only string, text, and slug aliases can be changed in place",
|
|
286
|
+
),
|
|
287
|
+
required: updateFieldBody.shape.required.describe(
|
|
288
|
+
"Whether the field is required; changing this requires a manual content migration",
|
|
289
|
+
),
|
|
290
|
+
unique: updateFieldBody.shape.unique.describe(
|
|
291
|
+
"Whether field values must be unique; changing this requires a manual content migration",
|
|
292
|
+
),
|
|
293
|
+
defaultValue: updateFieldBody.shape.defaultValue.describe("Default value for new content"),
|
|
294
|
+
validation: updateFieldBody.shape.validation.describe(
|
|
295
|
+
"Validation constraints; pass null to clear existing constraints",
|
|
296
|
+
),
|
|
297
|
+
widget: updateFieldBody.shape.widget.describe("Admin editor widget name"),
|
|
298
|
+
options: updateFieldBody.shape.options.describe("Widget configuration"),
|
|
299
|
+
sortOrder: updateFieldBody.shape.sortOrder.describe("Field order in the content editor"),
|
|
300
|
+
searchable: updateFieldBody.shape.searchable.describe(
|
|
301
|
+
"Whether full-text search indexes the field",
|
|
302
|
+
),
|
|
303
|
+
translatable: updateFieldBody.shape.translatable.describe(
|
|
304
|
+
"Whether values vary by locale; changing to false requires a manual content migration",
|
|
305
|
+
),
|
|
306
|
+
indexed: updateFieldBody.shape.indexed.describe(
|
|
307
|
+
"Create or remove a physical index for structured sorting",
|
|
308
|
+
),
|
|
309
|
+
});
|
|
310
|
+
|
|
70
311
|
// ---------------------------------------------------------------------------
|
|
71
312
|
// Helpers
|
|
72
313
|
// ---------------------------------------------------------------------------
|
|
@@ -79,6 +320,7 @@ type HandlerResult = {
|
|
|
79
320
|
|
|
80
321
|
type SuccessEnvelope = {
|
|
81
322
|
content: Array<{ type: "text"; text: string }>;
|
|
323
|
+
structuredContent?: Record<string, unknown>;
|
|
82
324
|
_meta?: Record<string, unknown>;
|
|
83
325
|
};
|
|
84
326
|
|
|
@@ -88,6 +330,58 @@ type ErrorEnvelope = {
|
|
|
88
330
|
_meta: { code: string; details?: Record<string, unknown> };
|
|
89
331
|
};
|
|
90
332
|
|
|
333
|
+
type TaxonomyListCursor = { id: string };
|
|
334
|
+
|
|
335
|
+
function encodeTaxonomyCursor(term: { id: string }): string {
|
|
336
|
+
const cursor = encodeBase64(
|
|
337
|
+
JSON.stringify({
|
|
338
|
+
v: TAXONOMY_CURSOR_VERSION,
|
|
339
|
+
id: term.id,
|
|
340
|
+
}),
|
|
341
|
+
);
|
|
342
|
+
if (cursor.length > MAX_TAXONOMY_CURSOR_LENGTH) {
|
|
343
|
+
throw new InvalidCursorError(cursor);
|
|
344
|
+
}
|
|
345
|
+
return cursor;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function decodeTaxonomyCursor(cursor: string): TaxonomyListCursor {
|
|
349
|
+
if (!cursor || cursor.length > MAX_TAXONOMY_CURSOR_LENGTH) {
|
|
350
|
+
throw new InvalidCursorError(cursor);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
let parsed: unknown;
|
|
354
|
+
try {
|
|
355
|
+
parsed = JSON.parse(decodeBase64(cursor));
|
|
356
|
+
} catch {
|
|
357
|
+
throw new InvalidCursorError(cursor);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
361
|
+
throw new InvalidCursorError(cursor);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const candidate = parsed as Record<string, unknown>;
|
|
365
|
+
if ("v" in candidate) {
|
|
366
|
+
const { v, id } = candidate;
|
|
367
|
+
if (
|
|
368
|
+
v !== TAXONOMY_CURSOR_VERSION ||
|
|
369
|
+
typeof id !== "string" ||
|
|
370
|
+
id.length === 0 ||
|
|
371
|
+
id.includes("\0")
|
|
372
|
+
) {
|
|
373
|
+
throw new InvalidCursorError(cursor);
|
|
374
|
+
}
|
|
375
|
+
return { id };
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const legacy = decodeCursor(cursor);
|
|
379
|
+
if (legacy.orderValue.includes("\0") || legacy.id.length === 0 || legacy.id.includes("\0")) {
|
|
380
|
+
throw new InvalidCursorError(cursor);
|
|
381
|
+
}
|
|
382
|
+
return { id: legacy.id };
|
|
383
|
+
}
|
|
384
|
+
|
|
91
385
|
/**
|
|
92
386
|
* Return a successful tool response with the data as pretty-printed JSON.
|
|
93
387
|
*/
|
|
@@ -233,16 +527,21 @@ function jsonResult(data: unknown): SuccessEnvelope {
|
|
|
233
527
|
// ---------------------------------------------------------------------------
|
|
234
528
|
// Context extraction
|
|
235
529
|
//
|
|
236
|
-
// The route handler passes
|
|
530
|
+
// The route handler passes the runtime and authenticated user in authInfo.extra.
|
|
237
531
|
// ---------------------------------------------------------------------------
|
|
238
532
|
|
|
239
533
|
interface EmDashExtra {
|
|
240
534
|
emdash: EmDashHandlers;
|
|
535
|
+
user: RouteCallerInput;
|
|
241
536
|
userId: string;
|
|
242
537
|
/** The authenticated user's RBAC role level. */
|
|
243
538
|
userRole: RoleLevel;
|
|
244
539
|
/** Token scopes — undefined for session auth (all access allowed). */
|
|
245
540
|
tokenScopes?: string[];
|
|
541
|
+
/** Id of the API or OAuth token the caller authenticated with. */
|
|
542
|
+
tokenId?: string;
|
|
543
|
+
/** The route cache of the MCP request, used to invalidate the same tags the REST routes do. */
|
|
544
|
+
cache?: APIContext["cache"];
|
|
246
545
|
}
|
|
247
546
|
|
|
248
547
|
function isPublished(t: unknown): boolean {
|
|
@@ -266,6 +565,83 @@ function getEmDash(extra: { authInfo?: { extra?: Record<string, unknown> } }): E
|
|
|
266
565
|
return getExtra(extra).emdash;
|
|
267
566
|
}
|
|
268
567
|
|
|
568
|
+
/**
|
|
569
|
+
* Unwrap a write result, first invalidating `tags` in the route cache when the
|
|
570
|
+
* write succeeded. Pass `changedEarlier` when an earlier step of the same tool
|
|
571
|
+
* already changed live content, so a failure in a later step still invalidates.
|
|
572
|
+
*/
|
|
573
|
+
async function unwrapAndInvalidate(
|
|
574
|
+
extra: { authInfo?: { extra?: Record<string, unknown> } },
|
|
575
|
+
result: HandlerResult,
|
|
576
|
+
tags: string[],
|
|
577
|
+
changedEarlier = false,
|
|
578
|
+
): Promise<SuccessEnvelope | ErrorEnvelope> {
|
|
579
|
+
if (result.success || changedEarlier) {
|
|
580
|
+
const { cache } = getExtra(extra);
|
|
581
|
+
if (cache?.enabled) await cache.invalidate({ tags });
|
|
582
|
+
}
|
|
583
|
+
return unwrap(result);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
async function getCollectionFields(
|
|
587
|
+
ec: EmDashHandlers,
|
|
588
|
+
collection: string,
|
|
589
|
+
): Promise<FieldSchema[] | null> {
|
|
590
|
+
try {
|
|
591
|
+
const { SchemaRegistry } = await import("../schema/index.js");
|
|
592
|
+
const { expandCollectionBlockFields } = await import("../schema/block-values.js");
|
|
593
|
+
const col = await new SchemaRegistry(ec.db).getCollectionWithFields(collection);
|
|
594
|
+
return col ? (await expandCollectionBlockFields(ec.db, col)).fields : null;
|
|
595
|
+
} catch {
|
|
596
|
+
return null;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Convert markdown strings to Portable Text for `portableText` fields on write.
|
|
602
|
+
* Non-string values pass through, so callers may still send Portable Text. If
|
|
603
|
+
* the schema can't be loaded, data is returned unchanged for the handler to
|
|
604
|
+
* validate.
|
|
605
|
+
*/
|
|
606
|
+
async function convertWriteData(
|
|
607
|
+
ec: EmDashHandlers,
|
|
608
|
+
collection: string,
|
|
609
|
+
data: Record<string, unknown>,
|
|
610
|
+
): Promise<Record<string, unknown>> {
|
|
611
|
+
const fields = await getCollectionFields(ec, collection);
|
|
612
|
+
if (!fields) return data;
|
|
613
|
+
return convertDataForWrite(data, fields);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Convert `portableText` field values on each item's `data` to markdown,
|
|
618
|
+
* mutating in place. Inverse of {@link convertWriteData}, gated on the read
|
|
619
|
+
* tools' `markdown` argument.
|
|
620
|
+
*/
|
|
621
|
+
async function applyReadMarkdown(
|
|
622
|
+
ec: EmDashHandlers,
|
|
623
|
+
collection: string,
|
|
624
|
+
items: Array<Record<string, unknown>>,
|
|
625
|
+
): Promise<void> {
|
|
626
|
+
const fields = await getCollectionFields(ec, collection);
|
|
627
|
+
if (!fields) return;
|
|
628
|
+
for (const item of items) {
|
|
629
|
+
if (item.data && typeof item.data === "object") {
|
|
630
|
+
item.data = convertDataForRead(
|
|
631
|
+
// eslint-disable-next-line typescript/no-unsafe-type-assertion -- narrowed by typeof check above
|
|
632
|
+
item.data as Record<string, unknown>,
|
|
633
|
+
fields,
|
|
634
|
+
false,
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
async function invalidateBylines(): Promise<void> {
|
|
641
|
+
const { invalidateBylineCache } = await import("../bylines/index.js");
|
|
642
|
+
invalidateBylineCache();
|
|
643
|
+
}
|
|
644
|
+
|
|
269
645
|
/**
|
|
270
646
|
* Enforce a scope requirement on the current request.
|
|
271
647
|
*
|
|
@@ -303,6 +679,61 @@ function requireRole(
|
|
|
303
679
|
}
|
|
304
680
|
}
|
|
305
681
|
|
|
682
|
+
type TransferScopeRequirement = TransferScope | "transfer:*";
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Whether the caller's token holds `scope` (`transfer:*`: any transfer
|
|
686
|
+
* scope). A caller without token scopes holds none.
|
|
687
|
+
*/
|
|
688
|
+
function transferScopeHeld(
|
|
689
|
+
extra: { authInfo?: { extra?: Record<string, unknown> } },
|
|
690
|
+
scope: TransferScopeRequirement,
|
|
691
|
+
): boolean {
|
|
692
|
+
const { tokenScopes } = getExtra(extra);
|
|
693
|
+
if (!tokenScopes) return false;
|
|
694
|
+
if (scope === "transfer:*") return TRANSFER_SCOPES.some((held) => hasScope(tokenScopes, held));
|
|
695
|
+
return hasScope(tokenScopes, scope);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
function insufficientTransferScope(scope: TransferScopeRequirement): EmDashAuthError {
|
|
699
|
+
const required = scope === "transfer:*" ? TRANSFER_SCOPES.join(" or ") : scope;
|
|
700
|
+
return new EmDashAuthError(`Insufficient scope: requires ${required}`, "INSUFFICIENT_SCOPE");
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
function requireTransferScope(
|
|
704
|
+
extra: { authInfo?: { extra?: Record<string, unknown> } },
|
|
705
|
+
scope: TransferScopeRequirement,
|
|
706
|
+
): void {
|
|
707
|
+
if (!transferScopeHeld(extra, scope)) throw insufficientTransferScope(scope);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Require `scope`, or a grant this user consumed with this token to start
|
|
712
|
+
* `operationId`.
|
|
713
|
+
*/
|
|
714
|
+
async function requireTransferAccess(
|
|
715
|
+
extra: { authInfo?: { extra?: Record<string, unknown> } },
|
|
716
|
+
scope: TransferScopeRequirement,
|
|
717
|
+
action: TransferApprovalAction,
|
|
718
|
+
operationId: string,
|
|
719
|
+
): Promise<void> {
|
|
720
|
+
if (transferScopeHeld(extra, scope)) return;
|
|
721
|
+
const { emdash, userId, tokenId } = getExtra(extra);
|
|
722
|
+
if (await hasOperationGrant(emdash.db, { userId, tokenId }, action, operationId)) return;
|
|
723
|
+
throw insufficientTransferScope(scope);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
function transferContext(extra: {
|
|
727
|
+
authInfo?: { extra?: Record<string, unknown> };
|
|
728
|
+
}): TransferContext {
|
|
729
|
+
const { emdash } = getExtra(extra);
|
|
730
|
+
return { db: emdash.db, storage: emdash.storage, maxUploadSize: emdash.config.maxUploadSize };
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function transferDigest(value: string) {
|
|
734
|
+
return toSha256Digest(value.slice("sha256:".length));
|
|
735
|
+
}
|
|
736
|
+
|
|
306
737
|
/**
|
|
307
738
|
* Whether the current user may read non-published content (drafts, scheduled,
|
|
308
739
|
* trashed, revisions, compare). SUBSCRIBER may hold content:read for
|
|
@@ -379,11 +810,50 @@ function extractContentId(data: unknown): string | undefined {
|
|
|
379
810
|
return typeof item?.id === "string" ? item.id : undefined;
|
|
380
811
|
}
|
|
381
812
|
|
|
813
|
+
/**
|
|
814
|
+
* Refuses a write while another user holds the entry's edit lock. Resolves to
|
|
815
|
+
* `null` when the write may proceed, and extends the caller's own lease if they
|
|
816
|
+
* hold it.
|
|
817
|
+
*/
|
|
818
|
+
async function refuseLockedEntry(
|
|
819
|
+
extra: { authInfo?: { extra?: Record<string, unknown> } },
|
|
820
|
+
collection: string,
|
|
821
|
+
entryId: string,
|
|
822
|
+
overrideLock: boolean | undefined,
|
|
823
|
+
): Promise<ErrorEnvelope | null> {
|
|
824
|
+
const { emdash, userId } = getExtra(extra);
|
|
825
|
+
const refusal = await claimEntryLockForWrite(emdash.db, collection, entryId, userId, {
|
|
826
|
+
override: overrideLock,
|
|
827
|
+
});
|
|
828
|
+
return refusal ? respondError(refusal.code, refusal.message, { ...refusal.details }) : null;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
/** Extract the `_rev` token from a content handler response. */
|
|
832
|
+
function extractContentRev(data: unknown): string | undefined {
|
|
833
|
+
if (!data || typeof data !== "object") return undefined;
|
|
834
|
+
const rev = (data as Record<string, unknown>)._rev;
|
|
835
|
+
return typeof rev === "string" ? rev : undefined;
|
|
836
|
+
}
|
|
837
|
+
|
|
382
838
|
// ---------------------------------------------------------------------------
|
|
383
839
|
// Server factory
|
|
384
840
|
// ---------------------------------------------------------------------------
|
|
385
841
|
|
|
386
|
-
export
|
|
842
|
+
export interface PluginMcpRegistration {
|
|
843
|
+
pluginId: string;
|
|
844
|
+
name: string;
|
|
845
|
+
description: string;
|
|
846
|
+
route: string;
|
|
847
|
+
permission: string;
|
|
848
|
+
destructive: boolean;
|
|
849
|
+
inputSchema: z.ZodType;
|
|
850
|
+
outputSchema?: z.ZodType;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
export function createMcpServer(
|
|
854
|
+
pluginTools: PluginMcpRegistration[] = [],
|
|
855
|
+
request?: Request,
|
|
856
|
+
): McpServer {
|
|
387
857
|
const server = new McpServer(
|
|
388
858
|
{ name: "emdash", version: "0.1.0" },
|
|
389
859
|
{ capabilities: { logging: {} } },
|
|
@@ -394,20 +864,38 @@ export function createMcpServer(): McpServer {
|
|
|
394
864
|
// surface as structured `_meta.code`-bearing tool error envelopes
|
|
395
865
|
// instead of the SDK's text-only fallback in createToolError().
|
|
396
866
|
//
|
|
867
|
+
// The wrapper also applies the site write fence. Every MCP request is a
|
|
868
|
+
// POST, so the fence middleware leaves the endpoint to this per-tool
|
|
869
|
+
// check: every tool is fenced unless it is annotated `readOnlyHint: true`
|
|
870
|
+
// or is a transfer tool. A tool annotated read-only must never write.
|
|
871
|
+
//
|
|
397
872
|
// Type-erased on purpose — the SDK's overloads are too narrow for a
|
|
398
873
|
// generic wrapper, but the runtime contract (callback returns the tool
|
|
399
874
|
// result envelope) holds for every registered tool.
|
|
400
875
|
const originalRegisterTool = server.registerTool.bind(server);
|
|
401
876
|
(server as { registerTool: typeof server.registerTool }).registerTool = ((
|
|
402
877
|
name: string,
|
|
403
|
-
config:
|
|
878
|
+
config: { annotations?: { readOnlyHint?: boolean } },
|
|
404
879
|
callback: (...callbackArgs: unknown[]) => Promise<SuccessEnvelope | ErrorEnvelope>,
|
|
405
880
|
) => {
|
|
881
|
+
const fenced = config.annotations?.readOnlyHint !== true && !TRANSFER_TOOL_NAMES.has(name);
|
|
406
882
|
const wrapped = async (
|
|
407
883
|
...callbackArgs: unknown[]
|
|
408
884
|
): Promise<SuccessEnvelope | ErrorEnvelope> => {
|
|
409
885
|
try {
|
|
410
|
-
return await callback(...callbackArgs);
|
|
886
|
+
if (!fenced) return await callback(...callbackArgs);
|
|
887
|
+
// The SDK passes the request extra as the last callback argument.
|
|
888
|
+
const extra = callbackArgs.at(-1) as { authInfo?: { extra?: Record<string, unknown> } };
|
|
889
|
+
const { db } = getEmDash(extra);
|
|
890
|
+
const fence = await readSiteWriteFence(db);
|
|
891
|
+
if (fence.error) return respondError(fence.error.code, fence.error.message);
|
|
892
|
+
const result = await callback(...callbackArgs);
|
|
893
|
+
// Recorded after the write so an export whose fence was captured
|
|
894
|
+
// while this tool ran still sees it.
|
|
895
|
+
if (fence.exportRunning && !("isError" in result && result.isError)) {
|
|
896
|
+
await recordSiteWrite(db);
|
|
897
|
+
}
|
|
898
|
+
return result;
|
|
411
899
|
} catch (error) {
|
|
412
900
|
return respondHandlerError(error, "INTERNAL_ERROR");
|
|
413
901
|
}
|
|
@@ -417,6 +905,81 @@ export function createMcpServer(): McpServer {
|
|
|
417
905
|
)(name, config, wrapped);
|
|
418
906
|
}) as typeof server.registerTool;
|
|
419
907
|
|
|
908
|
+
for (const tool of pluginTools) {
|
|
909
|
+
if (!Object.hasOwn(Permissions, tool.permission)) continue;
|
|
910
|
+
server.registerTool(
|
|
911
|
+
`${tool.pluginId}__${tool.name}`,
|
|
912
|
+
{
|
|
913
|
+
description: tool.description,
|
|
914
|
+
inputSchema: tool.inputSchema,
|
|
915
|
+
outputSchema: tool.outputSchema,
|
|
916
|
+
annotations: { destructiveHint: tool.destructive },
|
|
917
|
+
},
|
|
918
|
+
async (input, extra) => {
|
|
919
|
+
const payload = getExtra(extra);
|
|
920
|
+
const requiredScope = `mcp:tools:${tool.pluginId}`;
|
|
921
|
+
if (payload.tokenScopes && !hasScope(payload.tokenScopes, requiredScope)) {
|
|
922
|
+
if (request) {
|
|
923
|
+
await payload.emdash.handlePluginMcpDenied(
|
|
924
|
+
tool.pluginId,
|
|
925
|
+
tool.name,
|
|
926
|
+
tool.route,
|
|
927
|
+
payload.userId,
|
|
928
|
+
request,
|
|
929
|
+
`Missing scope: ${requiredScope}`,
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
throw new EmDashAuthError(
|
|
933
|
+
`Insufficient scope: requires ${requiredScope}`,
|
|
934
|
+
"INSUFFICIENT_SCOPE",
|
|
935
|
+
);
|
|
936
|
+
}
|
|
937
|
+
if (!hasPermission({ role: payload.userRole }, tool.permission as Permission)) {
|
|
938
|
+
if (request) {
|
|
939
|
+
await payload.emdash.handlePluginMcpDenied(
|
|
940
|
+
tool.pluginId,
|
|
941
|
+
tool.name,
|
|
942
|
+
tool.route,
|
|
943
|
+
payload.userId,
|
|
944
|
+
request,
|
|
945
|
+
`Missing permission: ${tool.permission}`,
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
throw new EmDashAuthError(
|
|
949
|
+
`Insufficient permission: requires ${tool.permission}`,
|
|
950
|
+
"INSUFFICIENT_PERMISSIONS",
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
if (!request) return respondError("INTERNAL_ERROR", "Missing MCP request context");
|
|
954
|
+
const routeCache = payload.cache;
|
|
955
|
+
const result = await payload.emdash.handlePluginMcpTool(
|
|
956
|
+
tool.pluginId,
|
|
957
|
+
tool.name,
|
|
958
|
+
tool.route,
|
|
959
|
+
input,
|
|
960
|
+
payload.userId,
|
|
961
|
+
request,
|
|
962
|
+
payload.user,
|
|
963
|
+
routeCache?.enabled ? (tags) => routeCache.invalidate({ tags }) : undefined,
|
|
964
|
+
);
|
|
965
|
+
if (!result.success) return unwrap(result);
|
|
966
|
+
if (tool.outputSchema) {
|
|
967
|
+
if (!result.data || typeof result.data !== "object" || Array.isArray(result.data)) {
|
|
968
|
+
return respondError(
|
|
969
|
+
"INVALID_PLUGIN_OUTPUT",
|
|
970
|
+
"Plugin tool output must be an object when outputSchema is declared",
|
|
971
|
+
);
|
|
972
|
+
}
|
|
973
|
+
return {
|
|
974
|
+
content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }],
|
|
975
|
+
structuredContent: result.data as Record<string, unknown>,
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
return respondData(result.data);
|
|
979
|
+
},
|
|
980
|
+
);
|
|
981
|
+
}
|
|
982
|
+
|
|
420
983
|
// =====================================================================
|
|
421
984
|
// Content tools
|
|
422
985
|
// =====================================================================
|
|
@@ -458,6 +1021,12 @@ export function createMcpServer(): McpServer {
|
|
|
458
1021
|
.string()
|
|
459
1022
|
.optional()
|
|
460
1023
|
.describe("Filter by locale (e.g. 'en', 'fr'). Only relevant when i18n is enabled."),
|
|
1024
|
+
markdown: z
|
|
1025
|
+
.boolean()
|
|
1026
|
+
.optional()
|
|
1027
|
+
.describe(
|
|
1028
|
+
"Return rich text (portableText) fields as Markdown strings instead of Portable Text arrays (default false).",
|
|
1029
|
+
),
|
|
461
1030
|
}),
|
|
462
1031
|
annotations: { readOnlyHint: true },
|
|
463
1032
|
},
|
|
@@ -467,16 +1036,26 @@ export function createMcpServer(): McpServer {
|
|
|
467
1036
|
// Subscribers must only see published content; force the status
|
|
468
1037
|
// filter regardless of caller-supplied value.
|
|
469
1038
|
const status = canReadDrafts(extra) ? args.status : "published";
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
1039
|
+
const result = await ec.handleContentList(args.collection, {
|
|
1040
|
+
status,
|
|
1041
|
+
limit: args.limit,
|
|
1042
|
+
cursor: args.cursor,
|
|
1043
|
+
orderBy: args.orderBy,
|
|
1044
|
+
order: args.order,
|
|
1045
|
+
locale: args.locale,
|
|
1046
|
+
});
|
|
1047
|
+
if (result.success && args.markdown) {
|
|
1048
|
+
const payload = result.data;
|
|
1049
|
+
if (
|
|
1050
|
+
payload &&
|
|
1051
|
+
typeof payload === "object" &&
|
|
1052
|
+
"items" in payload &&
|
|
1053
|
+
Array.isArray(payload.items)
|
|
1054
|
+
) {
|
|
1055
|
+
await applyReadMarkdown(ec, args.collection, payload.items);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
return unwrap(result);
|
|
480
1059
|
},
|
|
481
1060
|
);
|
|
482
1061
|
|
|
@@ -486,8 +1065,9 @@ export function createMcpServer(): McpServer {
|
|
|
486
1065
|
title: "Get Content",
|
|
487
1066
|
description:
|
|
488
1067
|
"Get a single content item by its ID or slug. Returns the full content data " +
|
|
489
|
-
"including all field values, metadata, and a _rev token
|
|
490
|
-
"
|
|
1068
|
+
"including all field values, metadata, and a _rev token. content_update, " +
|
|
1069
|
+
"content_publish, content_unpublish and content_discard_draft require that " +
|
|
1070
|
+
"token, so read the item here before calling them.",
|
|
491
1071
|
inputSchema: z.object({
|
|
492
1072
|
collection: z.string().describe("Collection slug (e.g. 'posts', 'pages')"),
|
|
493
1073
|
id: z.string().describe("Content item ID (ULID) or slug"),
|
|
@@ -497,6 +1077,12 @@ export function createMcpServer(): McpServer {
|
|
|
497
1077
|
.describe(
|
|
498
1078
|
"Locale to scope slug lookup (e.g. 'fr'). Only affects slug resolution; IDs are globally unique.",
|
|
499
1079
|
),
|
|
1080
|
+
markdown: z
|
|
1081
|
+
.boolean()
|
|
1082
|
+
.optional()
|
|
1083
|
+
.describe(
|
|
1084
|
+
"Return rich text (portableText) fields as Markdown strings instead of Portable Text arrays (default false).",
|
|
1085
|
+
),
|
|
500
1086
|
}),
|
|
501
1087
|
annotations: { readOnlyHint: true },
|
|
502
1088
|
},
|
|
@@ -509,12 +1095,12 @@ export function createMcpServer(): McpServer {
|
|
|
509
1095
|
if (result.success && !canReadDrafts(extra)) {
|
|
510
1096
|
const data =
|
|
511
1097
|
result.data && typeof result.data === "object"
|
|
512
|
-
? // eslint-disable-next-line typescript
|
|
1098
|
+
? // eslint-disable-next-line typescript/no-unsafe-type-assertion -- handler returns unknown data; narrowed by typeof check
|
|
513
1099
|
(result.data as Record<string, unknown>)
|
|
514
1100
|
: undefined;
|
|
515
1101
|
const item =
|
|
516
1102
|
data?.item && typeof data.item === "object"
|
|
517
|
-
? // eslint-disable-next-line typescript
|
|
1103
|
+
? // eslint-disable-next-line typescript/no-unsafe-type-assertion -- narrowed by typeof check
|
|
518
1104
|
(data.item as Record<string, unknown>)
|
|
519
1105
|
: undefined;
|
|
520
1106
|
const status = typeof item?.status === "string" ? item.status : null;
|
|
@@ -525,6 +1111,9 @@ export function createMcpServer(): McpServer {
|
|
|
525
1111
|
});
|
|
526
1112
|
}
|
|
527
1113
|
}
|
|
1114
|
+
if (result.success && args.markdown && result.data?.item) {
|
|
1115
|
+
await applyReadMarkdown(ec, args.collection, [result.data.item]);
|
|
1116
|
+
}
|
|
528
1117
|
return unwrap(result);
|
|
529
1118
|
},
|
|
530
1119
|
);
|
|
@@ -536,9 +1125,12 @@ export function createMcpServer(): McpServer {
|
|
|
536
1125
|
description:
|
|
537
1126
|
"Create a new content item in a collection. The 'data' object should " +
|
|
538
1127
|
"contain field values matching the collection's schema (use " +
|
|
539
|
-
"schema_get_collection to check).
|
|
540
|
-
"
|
|
541
|
-
"
|
|
1128
|
+
"schema_get_collection to check). For rich text (portableText) fields, " +
|
|
1129
|
+
"pass a Markdown string — converted to Portable Text automatically; prefer " +
|
|
1130
|
+
"this. Pass a Portable Text JSON array only for complex content Markdown " +
|
|
1131
|
+
"can't express (custom blocks, embeds). A slug is auto-generated if not " +
|
|
1132
|
+
"provided. Items are created as 'draft' by default — use content_publish " +
|
|
1133
|
+
"to make them live.",
|
|
542
1134
|
inputSchema: z.object({
|
|
543
1135
|
collection: z.string().describe("Collection slug (e.g. 'posts', 'pages')"),
|
|
544
1136
|
data: z
|
|
@@ -559,13 +1151,34 @@ export function createMcpServer(): McpServer {
|
|
|
559
1151
|
.describe(
|
|
560
1152
|
"ID of the content item this is a translation of. Links items in the same translation group.",
|
|
561
1153
|
),
|
|
1154
|
+
migrateBlocks: z
|
|
1155
|
+
.boolean()
|
|
1156
|
+
.optional()
|
|
1157
|
+
.describe("Allow retained blocks to migrate to their type's active version"),
|
|
1158
|
+
replaceBlocks: z
|
|
1159
|
+
.boolean()
|
|
1160
|
+
.optional()
|
|
1161
|
+
.describe("Treat an entirely keyless blocks array as an explicit replacement"),
|
|
1162
|
+
bylines: z
|
|
1163
|
+
.array(contentBylineInputSchema)
|
|
1164
|
+
.optional()
|
|
1165
|
+
.describe(
|
|
1166
|
+
"Bylines to credit. Each entry references an existing byline by id (see byline_list / byline_create) with an optional roleLabel. The first entry becomes the primary byline.",
|
|
1167
|
+
),
|
|
1168
|
+
taxonomies: z
|
|
1169
|
+
.record(z.string(), z.array(z.string()))
|
|
1170
|
+
.optional()
|
|
1171
|
+
.describe(
|
|
1172
|
+
"Taxonomy term assignments as { taxonomyName: [termSlug, ...] }. Term slugs are resolved in the entry's locale. Call taxonomy_list to see available taxonomies and taxonomy_list_terms to look up slugs. Missing keys leave that taxonomy unchanged.",
|
|
1173
|
+
),
|
|
562
1174
|
}),
|
|
563
1175
|
annotations: { destructiveHint: false },
|
|
564
1176
|
},
|
|
565
1177
|
async (args, extra) => {
|
|
566
1178
|
requireScope(extra, "content:write");
|
|
567
1179
|
requireRole(extra, Role.CONTRIBUTOR);
|
|
568
|
-
const { emdash, userId } = getExtra(extra);
|
|
1180
|
+
const { emdash, userId, userRole } = getExtra(extra);
|
|
1181
|
+
const actor = { id: userId, role: userRole };
|
|
569
1182
|
|
|
570
1183
|
// Creating a translation requires edit permission on the source item
|
|
571
1184
|
if (args.translationOf) {
|
|
@@ -579,38 +1192,60 @@ export function createMcpServer(): McpServer {
|
|
|
579
1192
|
);
|
|
580
1193
|
}
|
|
581
1194
|
|
|
1195
|
+
const data = await convertWriteData(emdash, args.collection, args.data);
|
|
1196
|
+
|
|
582
1197
|
// Publishing requires publish permission — create as draft then publish
|
|
583
1198
|
if (args.status === "published") {
|
|
584
|
-
const user = { id: userId, role:
|
|
585
|
-
if (!hasPermission(user, "content:publish_own"
|
|
1199
|
+
const user = { id: userId, role: userRole };
|
|
1200
|
+
if (!hasPermission(user, "content:publish_own")) {
|
|
586
1201
|
throw new EmDashAuthError(
|
|
587
1202
|
"Insufficient permissions: publishing requires content:publish_own",
|
|
588
1203
|
"INSUFFICIENT_PERMISSIONS",
|
|
589
1204
|
);
|
|
590
1205
|
}
|
|
591
1206
|
const result = await emdash.handleContentCreate(args.collection, {
|
|
592
|
-
data
|
|
1207
|
+
data,
|
|
593
1208
|
slug: args.slug,
|
|
594
1209
|
authorId: userId,
|
|
595
1210
|
locale: args.locale,
|
|
596
1211
|
translationOf: args.translationOf,
|
|
1212
|
+
bylines: args.bylines,
|
|
1213
|
+
taxonomies: args.taxonomies,
|
|
1214
|
+
migrateBlocks: args.migrateBlocks,
|
|
1215
|
+
replaceBlocks: args.replaceBlocks,
|
|
1216
|
+
actor,
|
|
597
1217
|
});
|
|
598
1218
|
if (!result.success) return unwrap(result);
|
|
599
1219
|
const itemId = extractContentId(result.data);
|
|
600
1220
|
if (itemId) {
|
|
601
|
-
return
|
|
1221
|
+
return unwrapAndInvalidate(
|
|
1222
|
+
extra,
|
|
1223
|
+
await emdash.handleContentPublish(args.collection, itemId, {
|
|
1224
|
+
actor: { ...actor, source: "mcp" },
|
|
1225
|
+
origin: { source: "mcp" },
|
|
1226
|
+
}),
|
|
1227
|
+
[args.collection, itemId],
|
|
1228
|
+
true,
|
|
1229
|
+
);
|
|
602
1230
|
}
|
|
603
|
-
return
|
|
1231
|
+
return unwrapAndInvalidate(extra, result, [args.collection]);
|
|
604
1232
|
}
|
|
605
1233
|
|
|
606
|
-
return
|
|
1234
|
+
return unwrapAndInvalidate(
|
|
1235
|
+
extra,
|
|
607
1236
|
await emdash.handleContentCreate(args.collection, {
|
|
608
|
-
data
|
|
1237
|
+
data,
|
|
609
1238
|
slug: args.slug,
|
|
610
1239
|
authorId: userId,
|
|
611
1240
|
locale: args.locale,
|
|
612
1241
|
translationOf: args.translationOf,
|
|
1242
|
+
bylines: args.bylines,
|
|
1243
|
+
taxonomies: args.taxonomies,
|
|
1244
|
+
migrateBlocks: args.migrateBlocks,
|
|
1245
|
+
replaceBlocks: args.replaceBlocks,
|
|
1246
|
+
actor,
|
|
613
1247
|
}),
|
|
1248
|
+
[args.collection],
|
|
614
1249
|
);
|
|
615
1250
|
},
|
|
616
1251
|
);
|
|
@@ -621,12 +1256,27 @@ export function createMcpServer(): McpServer {
|
|
|
621
1256
|
title: "Update Content",
|
|
622
1257
|
description:
|
|
623
1258
|
"Update an existing content item. Only include fields you want to change " +
|
|
624
|
-
"in the 'data' object — unspecified fields are left unchanged.
|
|
625
|
-
"
|
|
626
|
-
"
|
|
1259
|
+
"in the 'data' object — unspecified fields are left unchanged. Rich text " +
|
|
1260
|
+
"(portableText) fields accept a Markdown string (recommended, converted " +
|
|
1261
|
+
"automatically); use a Portable Text JSON array only for complex content " +
|
|
1262
|
+
"Markdown can't express (custom blocks, embeds). Requires the _rev " +
|
|
1263
|
+
"token from content_get, so read the item before updating it: the " +
|
|
1264
|
+
"update fails if the item changed since that read. When status is not " +
|
|
1265
|
+
"set, a change to a published item is staged as a draft, so the " +
|
|
1266
|
+
"response shows the new values while the live version keeps the old " +
|
|
1267
|
+
"ones until content_publish. " +
|
|
1268
|
+
"`seo` and `bylines` are persisted alongside the field updates in a " +
|
|
1269
|
+
"single transaction. `publishedAt` requires the content:publish_any " +
|
|
1270
|
+
"permission and is useful for migrations or correcting historical dates.",
|
|
627
1271
|
inputSchema: z.object({
|
|
628
1272
|
collection: z.string().describe("Collection slug"),
|
|
629
1273
|
id: z.string().describe("Content item ID or slug"),
|
|
1274
|
+
locale: z
|
|
1275
|
+
.string()
|
|
1276
|
+
.optional()
|
|
1277
|
+
.describe(
|
|
1278
|
+
"Locale to scope slug lookup (e.g. 'fr'). Only affects slug resolution; IDs are globally unique.",
|
|
1279
|
+
),
|
|
630
1280
|
data: z
|
|
631
1281
|
.record(z.string(), z.unknown())
|
|
632
1282
|
.optional()
|
|
@@ -638,78 +1288,181 @@ export function createMcpServer(): McpServer {
|
|
|
638
1288
|
.describe(
|
|
639
1289
|
"New status. Setting to 'published' requires publish permission. Setting to 'draft' unpublishes the item and also requires publish permission.",
|
|
640
1290
|
),
|
|
641
|
-
|
|
642
|
-
|
|
1291
|
+
// Reuse the REST schema rather than redefining inline. The REST schema's
|
|
1292
|
+
// `canonical` field is gated through `httpUrl` (validates the URL parses
|
|
1293
|
+
// AND has an http(s) scheme) which rejects javascript:/data: URIs that
|
|
1294
|
+
// would otherwise become stored XSS in the rendered <link rel="canonical">.
|
|
1295
|
+
// Inlining a looser shape here would let MCP callers bypass that.
|
|
1296
|
+
seo: contentSeoInput
|
|
1297
|
+
.optional()
|
|
1298
|
+
.describe(
|
|
1299
|
+
"Per-content SEO metadata. Only valid for collections with SEO enabled (see schema_get_collection.hasSeo). Fields not included are left unchanged; pass null to clear.",
|
|
1300
|
+
),
|
|
1301
|
+
bylines: z
|
|
1302
|
+
.array(contentBylineInputSchema)
|
|
1303
|
+
.optional()
|
|
1304
|
+
.describe(
|
|
1305
|
+
"Replace the byline list for this item. The first entry becomes the primary byline. Pass an empty array to clear all bylines.",
|
|
1306
|
+
),
|
|
1307
|
+
taxonomies: z
|
|
1308
|
+
.record(z.string(), z.array(z.string()))
|
|
1309
|
+
.optional()
|
|
1310
|
+
.describe(
|
|
1311
|
+
"Replace taxonomy term assignments as { taxonomyName: [termSlug, ...] }. Term slugs are resolved in the entry's locale. Only named taxonomies are touched; other taxonomies are left unchanged. Pass an empty array to clear a taxonomy.",
|
|
1312
|
+
),
|
|
1313
|
+
publishedAt: contentDateTimeInputSchema
|
|
1314
|
+
.nullish()
|
|
1315
|
+
.describe(
|
|
1316
|
+
"Override the publication timestamp (ISO 8601). Requires content:publish_any permission. Pass null to clear. Useful for content migrations.",
|
|
1317
|
+
),
|
|
1318
|
+
migrateBlocks: z
|
|
1319
|
+
.boolean()
|
|
643
1320
|
.optional()
|
|
644
|
-
.describe("
|
|
1321
|
+
.describe("Allow existing blocks to migrate to their type's active version"),
|
|
1322
|
+
replaceBlocks: z
|
|
1323
|
+
.boolean()
|
|
1324
|
+
.optional()
|
|
1325
|
+
.describe("Treat an entirely keyless blocks array as an explicit replacement"),
|
|
1326
|
+
_rev: z.string({ error: REV_MISSING_ERROR }).describe(REV_PARAM_DESCRIPTION),
|
|
1327
|
+
overrideLock: z.boolean().optional().describe(OVERRIDE_LOCK_PARAM_DESCRIPTION),
|
|
645
1328
|
}),
|
|
646
1329
|
},
|
|
647
1330
|
async (args, extra) => {
|
|
648
1331
|
requireScope(extra, "content:write");
|
|
649
1332
|
requireRole(extra, Role.AUTHOR);
|
|
650
|
-
const { emdash, userId } = getExtra(extra);
|
|
1333
|
+
const { emdash, userId, userRole } = getExtra(extra);
|
|
1334
|
+
const actor = { id: userId, role: userRole };
|
|
651
1335
|
|
|
652
1336
|
// Fetch item to check ownership
|
|
653
|
-
const existing = await emdash.handleContentGet(args.collection, args.id);
|
|
1337
|
+
const existing = await emdash.handleContentGet(args.collection, args.id, args.locale);
|
|
654
1338
|
if (!existing.success) {
|
|
655
1339
|
return unwrap(existing);
|
|
656
1340
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
1341
|
+
const ownerId = extractContentAuthorId(existing.data);
|
|
1342
|
+
requireOwnership(extra, ownerId, "content:edit_own", "content:edit_any");
|
|
1343
|
+
|
|
1344
|
+
const data = args.data
|
|
1345
|
+
? await convertWriteData(emdash, args.collection, args.data)
|
|
1346
|
+
: args.data;
|
|
1347
|
+
|
|
1348
|
+
// Writing publishedAt directly (incl. clearing to null) overwrites
|
|
1349
|
+
// historical record — gate behind publish_any, mirroring the REST PUT
|
|
1350
|
+
// route. Status-driven publishes are gated separately below.
|
|
1351
|
+
if (args.publishedAt !== undefined) {
|
|
1352
|
+
const user = { id: userId, role: userRole };
|
|
1353
|
+
if (!hasPermission(user, "content:publish_any")) {
|
|
1354
|
+
throw new EmDashAuthError(
|
|
1355
|
+
"Setting publishedAt requires content:publish_any permission",
|
|
1356
|
+
"INSUFFICIENT_PERMISSIONS",
|
|
1357
|
+
);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
663
1360
|
|
|
664
1361
|
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
665
1362
|
|
|
1363
|
+
if (args.status !== undefined) {
|
|
1364
|
+
requireOwnership(extra, ownerId, "content:publish_own", "content:publish_any");
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
const locked = await refuseLockedEntry(extra, args.collection, resolvedId, args.overrideLock);
|
|
1368
|
+
if (locked) return locked;
|
|
1369
|
+
|
|
666
1370
|
// Status transitions route through dedicated handlers for proper revision management
|
|
667
1371
|
if (args.status === "published") {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
1372
|
+
let rev: string | undefined = args._rev;
|
|
1373
|
+
let liveChanged = false;
|
|
1374
|
+
if (
|
|
1375
|
+
args.data ||
|
|
1376
|
+
args.slug ||
|
|
1377
|
+
args.seo !== undefined ||
|
|
1378
|
+
args.bylines !== undefined ||
|
|
1379
|
+
args.taxonomies !== undefined ||
|
|
1380
|
+
args.publishedAt !== undefined
|
|
1381
|
+
) {
|
|
675
1382
|
const updateResult = await emdash.handleContentUpdate(args.collection, resolvedId, {
|
|
676
|
-
data
|
|
1383
|
+
data,
|
|
677
1384
|
slug: args.slug,
|
|
678
|
-
|
|
1385
|
+
actor,
|
|
1386
|
+
locale: args.locale,
|
|
1387
|
+
seo: args.seo,
|
|
1388
|
+
bylines: args.bylines,
|
|
1389
|
+
taxonomies: args.taxonomies,
|
|
1390
|
+
publishedAt: args.publishedAt,
|
|
1391
|
+
migrateBlocks: args.migrateBlocks,
|
|
1392
|
+
replaceBlocks: args.replaceBlocks,
|
|
679
1393
|
_rev: args._rev,
|
|
680
1394
|
});
|
|
681
1395
|
if (!updateResult.success) return unwrap(updateResult);
|
|
1396
|
+
liveChanged = updateResult.liveContentChanged !== false;
|
|
1397
|
+
rev = extractContentRev(updateResult.data);
|
|
682
1398
|
}
|
|
683
|
-
return
|
|
1399
|
+
return unwrapAndInvalidate(
|
|
1400
|
+
extra,
|
|
1401
|
+
await emdash.handleContentPublish(args.collection, resolvedId, {
|
|
1402
|
+
_rev: rev,
|
|
1403
|
+
actor: { ...actor, source: "mcp" },
|
|
1404
|
+
origin: { source: "mcp" },
|
|
1405
|
+
}),
|
|
1406
|
+
[args.collection, resolvedId],
|
|
1407
|
+
liveChanged,
|
|
1408
|
+
);
|
|
684
1409
|
}
|
|
685
1410
|
|
|
686
1411
|
if (args.status === "draft") {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
1412
|
+
let rev: string | undefined = args._rev;
|
|
1413
|
+
let liveChanged = false;
|
|
1414
|
+
if (
|
|
1415
|
+
args.data ||
|
|
1416
|
+
args.slug ||
|
|
1417
|
+
args.seo !== undefined ||
|
|
1418
|
+
args.bylines !== undefined ||
|
|
1419
|
+
args.taxonomies !== undefined ||
|
|
1420
|
+
args.publishedAt !== undefined
|
|
1421
|
+
) {
|
|
694
1422
|
const updateResult = await emdash.handleContentUpdate(args.collection, resolvedId, {
|
|
695
|
-
data
|
|
1423
|
+
data,
|
|
696
1424
|
slug: args.slug,
|
|
697
|
-
|
|
1425
|
+
actor,
|
|
1426
|
+
locale: args.locale,
|
|
1427
|
+
seo: args.seo,
|
|
1428
|
+
bylines: args.bylines,
|
|
1429
|
+
taxonomies: args.taxonomies,
|
|
1430
|
+
publishedAt: args.publishedAt,
|
|
1431
|
+
migrateBlocks: args.migrateBlocks,
|
|
1432
|
+
replaceBlocks: args.replaceBlocks,
|
|
698
1433
|
_rev: args._rev,
|
|
699
1434
|
});
|
|
700
1435
|
if (!updateResult.success) return unwrap(updateResult);
|
|
1436
|
+
liveChanged = updateResult.liveContentChanged !== false;
|
|
1437
|
+
rev = extractContentRev(updateResult.data);
|
|
701
1438
|
}
|
|
702
|
-
return
|
|
1439
|
+
return unwrapAndInvalidate(
|
|
1440
|
+
extra,
|
|
1441
|
+
await emdash.handleContentUnpublish(args.collection, resolvedId, {
|
|
1442
|
+
_rev: rev,
|
|
1443
|
+
actor: { ...actor, source: "mcp" },
|
|
1444
|
+
origin: { source: "mcp" },
|
|
1445
|
+
}),
|
|
1446
|
+
[args.collection, resolvedId],
|
|
1447
|
+
liveChanged,
|
|
1448
|
+
);
|
|
703
1449
|
}
|
|
704
1450
|
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
1451
|
+
const result = await emdash.handleContentUpdate(args.collection, resolvedId, {
|
|
1452
|
+
data,
|
|
1453
|
+
slug: args.slug,
|
|
1454
|
+
actor,
|
|
1455
|
+
locale: args.locale,
|
|
1456
|
+
seo: args.seo,
|
|
1457
|
+
bylines: args.bylines,
|
|
1458
|
+
taxonomies: args.taxonomies,
|
|
1459
|
+
publishedAt: args.publishedAt,
|
|
1460
|
+
migrateBlocks: args.migrateBlocks,
|
|
1461
|
+
replaceBlocks: args.replaceBlocks,
|
|
1462
|
+
_rev: args._rev,
|
|
1463
|
+
});
|
|
1464
|
+
if (result.liveContentChanged === false) return unwrap(result);
|
|
1465
|
+
return unwrapAndInvalidate(extra, result, [args.collection, resolvedId]);
|
|
713
1466
|
},
|
|
714
1467
|
);
|
|
715
1468
|
|
|
@@ -724,6 +1477,7 @@ export function createMcpServer(): McpServer {
|
|
|
724
1477
|
inputSchema: z.object({
|
|
725
1478
|
collection: z.string().describe("Collection slug"),
|
|
726
1479
|
id: z.string().describe("Content item ID or slug"),
|
|
1480
|
+
overrideLock: z.boolean().optional().describe(OVERRIDE_LOCK_PARAM_DESCRIPTION),
|
|
727
1481
|
}),
|
|
728
1482
|
annotations: { destructiveHint: true },
|
|
729
1483
|
},
|
|
@@ -745,7 +1499,12 @@ export function createMcpServer(): McpServer {
|
|
|
745
1499
|
);
|
|
746
1500
|
|
|
747
1501
|
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
748
|
-
|
|
1502
|
+
const locked = await refuseLockedEntry(extra, args.collection, resolvedId, args.overrideLock);
|
|
1503
|
+
if (locked) return locked;
|
|
1504
|
+
return unwrapAndInvalidate(extra, await ec.handleContentDelete(args.collection, resolvedId), [
|
|
1505
|
+
args.collection,
|
|
1506
|
+
resolvedId,
|
|
1507
|
+
]);
|
|
749
1508
|
},
|
|
750
1509
|
);
|
|
751
1510
|
|
|
@@ -753,7 +1512,9 @@ export function createMcpServer(): McpServer {
|
|
|
753
1512
|
"content_restore",
|
|
754
1513
|
{
|
|
755
1514
|
title: "Restore Content",
|
|
756
|
-
description:
|
|
1515
|
+
description:
|
|
1516
|
+
"Restore a soft-deleted content item from the trash. It comes back as a draft " +
|
|
1517
|
+
"with no schedule, even if it was published or scheduled before it was trashed.",
|
|
757
1518
|
inputSchema: z.object({
|
|
758
1519
|
collection: z.string().describe("Collection slug"),
|
|
759
1520
|
id: z.string().describe("Content item ID or slug"),
|
|
@@ -777,7 +1538,11 @@ export function createMcpServer(): McpServer {
|
|
|
777
1538
|
);
|
|
778
1539
|
|
|
779
1540
|
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
780
|
-
return
|
|
1541
|
+
return unwrapAndInvalidate(
|
|
1542
|
+
extra,
|
|
1543
|
+
await ec.handleContentRestore(args.collection, resolvedId),
|
|
1544
|
+
[args.collection, resolvedId],
|
|
1545
|
+
);
|
|
781
1546
|
},
|
|
782
1547
|
);
|
|
783
1548
|
|
|
@@ -798,7 +1563,11 @@ export function createMcpServer(): McpServer {
|
|
|
798
1563
|
requireScope(extra, "content:write");
|
|
799
1564
|
requireRole(extra, Role.ADMIN);
|
|
800
1565
|
const ec = getEmDash(extra);
|
|
801
|
-
return
|
|
1566
|
+
return unwrapAndInvalidate(
|
|
1567
|
+
extra,
|
|
1568
|
+
await ec.handleContentPermanentDelete(args.collection, args.id),
|
|
1569
|
+
[args.collection, args.id],
|
|
1570
|
+
);
|
|
802
1571
|
},
|
|
803
1572
|
);
|
|
804
1573
|
|
|
@@ -809,31 +1578,61 @@ export function createMcpServer(): McpServer {
|
|
|
809
1578
|
description:
|
|
810
1579
|
"Publish a content item, making it live on the site. Creates a published " +
|
|
811
1580
|
"revision from the current draft. Further edits create a new draft without " +
|
|
812
|
-
"affecting the live version until re-published."
|
|
1581
|
+
"affecting the live version until re-published. Pass `publishedAt` to " +
|
|
1582
|
+
"backdate (e.g. when migrating content from another CMS) — this requires " +
|
|
1583
|
+
"the content:publish_any permission. Without `publishedAt`, the existing " +
|
|
1584
|
+
"`published_at` is preserved on re-publish (idempotent) and falls back to " +
|
|
1585
|
+
"the current time on first publish.",
|
|
813
1586
|
inputSchema: z.object({
|
|
814
1587
|
collection: z.string().describe("Collection slug"),
|
|
815
1588
|
id: z.string().describe("Content item ID or slug"),
|
|
1589
|
+
_rev: z.string({ error: REV_MISSING_ERROR }).describe(REV_PARAM_DESCRIPTION),
|
|
1590
|
+
publishedAt: contentDateTimeInputSchema
|
|
1591
|
+
.optional()
|
|
1592
|
+
.describe(
|
|
1593
|
+
"Override publication timestamp (ISO 8601). Requires content:publish_any permission. Useful when importing content with original publish dates.",
|
|
1594
|
+
),
|
|
1595
|
+
overrideLock: z.boolean().optional().describe(OVERRIDE_LOCK_PARAM_DESCRIPTION),
|
|
816
1596
|
}),
|
|
817
1597
|
},
|
|
818
1598
|
async (args, extra) => {
|
|
819
1599
|
requireScope(extra, "content:write");
|
|
820
1600
|
requireRole(extra, Role.AUTHOR);
|
|
821
|
-
const
|
|
1601
|
+
const { emdash, userId, userRole } = getExtra(extra);
|
|
822
1602
|
|
|
823
1603
|
// Fetch item to check ownership
|
|
824
|
-
const existing = await
|
|
1604
|
+
const existing = await emdash.handleContentGet(args.collection, args.id);
|
|
825
1605
|
if (!existing.success) {
|
|
826
1606
|
return unwrap(existing);
|
|
827
1607
|
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
)
|
|
1608
|
+
const ownerId = extractContentAuthorId(existing.data);
|
|
1609
|
+
requireOwnership(extra, ownerId, "content:publish_own", "content:publish_any");
|
|
1610
|
+
|
|
1611
|
+
// Backdating overwrites historical record — gate behind publish_any
|
|
1612
|
+
// regardless of ownership (mirrors the REST PUT route's publishedAt gate).
|
|
1613
|
+
if (args.publishedAt !== undefined) {
|
|
1614
|
+
const user = { id: userId, role: userRole };
|
|
1615
|
+
if (!hasPermission(user, "content:publish_any")) {
|
|
1616
|
+
throw new EmDashAuthError(
|
|
1617
|
+
"Setting publishedAt requires content:publish_any permission",
|
|
1618
|
+
"INSUFFICIENT_PERMISSIONS",
|
|
1619
|
+
);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
834
1622
|
|
|
835
1623
|
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
836
|
-
|
|
1624
|
+
const locked = await refuseLockedEntry(extra, args.collection, resolvedId, args.overrideLock);
|
|
1625
|
+
if (locked) return locked;
|
|
1626
|
+
return unwrapAndInvalidate(
|
|
1627
|
+
extra,
|
|
1628
|
+
await emdash.handleContentPublish(args.collection, resolvedId, {
|
|
1629
|
+
publishedAt: args.publishedAt,
|
|
1630
|
+
_rev: args._rev,
|
|
1631
|
+
actor: { id: userId, role: userRole, source: "mcp" },
|
|
1632
|
+
origin: { source: "mcp" },
|
|
1633
|
+
}),
|
|
1634
|
+
[args.collection, resolvedId],
|
|
1635
|
+
);
|
|
837
1636
|
},
|
|
838
1637
|
);
|
|
839
1638
|
|
|
@@ -843,16 +1642,19 @@ export function createMcpServer(): McpServer {
|
|
|
843
1642
|
title: "Unpublish Content",
|
|
844
1643
|
description:
|
|
845
1644
|
"Unpublish a content item, reverting it to draft status. It will no " +
|
|
846
|
-
"longer be visible on the live site but its content
|
|
1645
|
+
"longer be visible on the live site, but its content and publication date are preserved. " +
|
|
1646
|
+
"Any pending schedule is cancelled.",
|
|
847
1647
|
inputSchema: z.object({
|
|
848
1648
|
collection: z.string().describe("Collection slug"),
|
|
849
1649
|
id: z.string().describe("Content item ID or slug"),
|
|
1650
|
+
_rev: z.string({ error: REV_MISSING_ERROR }).describe(REV_PARAM_DESCRIPTION),
|
|
1651
|
+
overrideLock: z.boolean().optional().describe(OVERRIDE_LOCK_PARAM_DESCRIPTION),
|
|
850
1652
|
}),
|
|
851
1653
|
},
|
|
852
1654
|
async (args, extra) => {
|
|
853
1655
|
requireScope(extra, "content:write");
|
|
854
1656
|
requireRole(extra, Role.AUTHOR);
|
|
855
|
-
const ec =
|
|
1657
|
+
const { emdash: ec, userId, userRole } = getExtra(extra);
|
|
856
1658
|
|
|
857
1659
|
// Fetch item to check ownership
|
|
858
1660
|
const existing = await ec.handleContentGet(args.collection, args.id);
|
|
@@ -867,7 +1669,17 @@ export function createMcpServer(): McpServer {
|
|
|
867
1669
|
);
|
|
868
1670
|
|
|
869
1671
|
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
870
|
-
|
|
1672
|
+
const locked = await refuseLockedEntry(extra, args.collection, resolvedId, args.overrideLock);
|
|
1673
|
+
if (locked) return locked;
|
|
1674
|
+
return unwrapAndInvalidate(
|
|
1675
|
+
extra,
|
|
1676
|
+
await ec.handleContentUnpublish(args.collection, resolvedId, {
|
|
1677
|
+
_rev: args._rev,
|
|
1678
|
+
actor: { id: userId, role: userRole, source: "mcp" },
|
|
1679
|
+
origin: { source: "mcp" },
|
|
1680
|
+
}),
|
|
1681
|
+
[args.collection, resolvedId],
|
|
1682
|
+
);
|
|
871
1683
|
},
|
|
872
1684
|
);
|
|
873
1685
|
|
|
@@ -882,15 +1694,17 @@ export function createMcpServer(): McpServer {
|
|
|
882
1694
|
inputSchema: z.object({
|
|
883
1695
|
collection: z.string().describe("Collection slug"),
|
|
884
1696
|
id: z.string().describe("Content item ID or slug"),
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
1697
|
+
_rev: z.string({ error: REV_MISSING_ERROR }).describe(REV_PARAM_DESCRIPTION),
|
|
1698
|
+
scheduledAt: contentDateTimeInputSchema.describe(
|
|
1699
|
+
"ISO 8601 datetime for publication (e.g. '2025-06-01T09:00:00Z')",
|
|
1700
|
+
),
|
|
1701
|
+
overrideLock: z.boolean().optional().describe(OVERRIDE_LOCK_PARAM_DESCRIPTION),
|
|
888
1702
|
}),
|
|
889
1703
|
},
|
|
890
1704
|
async (args, extra) => {
|
|
891
1705
|
requireScope(extra, "content:write");
|
|
892
1706
|
requireRole(extra, Role.AUTHOR);
|
|
893
|
-
const ec =
|
|
1707
|
+
const { emdash: ec, userId, userRole } = getExtra(extra);
|
|
894
1708
|
|
|
895
1709
|
// Fetch item to check ownership
|
|
896
1710
|
const existing = await ec.handleContentGet(args.collection, args.id);
|
|
@@ -905,7 +1719,17 @@ export function createMcpServer(): McpServer {
|
|
|
905
1719
|
);
|
|
906
1720
|
|
|
907
1721
|
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
908
|
-
|
|
1722
|
+
const locked = await refuseLockedEntry(extra, args.collection, resolvedId, args.overrideLock);
|
|
1723
|
+
if (locked) return locked;
|
|
1724
|
+
return unwrapAndInvalidate(
|
|
1725
|
+
extra,
|
|
1726
|
+
await ec.handleContentSchedule(args.collection, resolvedId, args.scheduledAt, {
|
|
1727
|
+
_rev: args._rev,
|
|
1728
|
+
actor: { id: userId, role: userRole, source: "mcp" },
|
|
1729
|
+
origin: { source: "mcp" },
|
|
1730
|
+
}),
|
|
1731
|
+
[args.collection, resolvedId],
|
|
1732
|
+
);
|
|
909
1733
|
},
|
|
910
1734
|
);
|
|
911
1735
|
|
|
@@ -914,12 +1738,13 @@ export function createMcpServer(): McpServer {
|
|
|
914
1738
|
{
|
|
915
1739
|
title: "Cancel Scheduled Publication",
|
|
916
1740
|
description:
|
|
917
|
-
"Cancel a previously scheduled publication.
|
|
918
|
-
"
|
|
919
|
-
"
|
|
1741
|
+
"Cancel a previously scheduled publication. Scheduled drafts return to draft status; " +
|
|
1742
|
+
"published items stay published. The scheduledAt timestamp is cleared. Idempotent — " +
|
|
1743
|
+
"calling on an item that isn't scheduled is a no-op.",
|
|
920
1744
|
inputSchema: z.object({
|
|
921
1745
|
collection: z.string().describe("Collection slug"),
|
|
922
1746
|
id: z.string().describe("Content item ID or slug"),
|
|
1747
|
+
overrideLock: z.boolean().optional().describe(OVERRIDE_LOCK_PARAM_DESCRIPTION),
|
|
923
1748
|
}),
|
|
924
1749
|
},
|
|
925
1750
|
async (args, extra) => {
|
|
@@ -939,7 +1764,13 @@ export function createMcpServer(): McpServer {
|
|
|
939
1764
|
);
|
|
940
1765
|
|
|
941
1766
|
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
942
|
-
|
|
1767
|
+
const locked = await refuseLockedEntry(extra, args.collection, resolvedId, args.overrideLock);
|
|
1768
|
+
if (locked) return locked;
|
|
1769
|
+
return unwrapAndInvalidate(
|
|
1770
|
+
extra,
|
|
1771
|
+
await ec.handleContentUnschedule(args.collection, resolvedId),
|
|
1772
|
+
[args.collection, resolvedId],
|
|
1773
|
+
);
|
|
943
1774
|
},
|
|
944
1775
|
);
|
|
945
1776
|
|
|
@@ -970,11 +1801,13 @@ export function createMcpServer(): McpServer {
|
|
|
970
1801
|
{
|
|
971
1802
|
title: "Discard Draft",
|
|
972
1803
|
description:
|
|
973
|
-
"Discard the current draft
|
|
974
|
-
"version
|
|
1804
|
+
"Discard the current draft revision. Published content reverts to its live " +
|
|
1805
|
+
"version; an item without a pending draft is unchanged.",
|
|
975
1806
|
inputSchema: z.object({
|
|
976
1807
|
collection: z.string().describe("Collection slug"),
|
|
977
1808
|
id: z.string().describe("Content item ID or slug"),
|
|
1809
|
+
_rev: z.string({ error: REV_MISSING_ERROR }).describe(REV_PARAM_DESCRIPTION),
|
|
1810
|
+
overrideLock: z.boolean().optional().describe(OVERRIDE_LOCK_PARAM_DESCRIPTION),
|
|
978
1811
|
}),
|
|
979
1812
|
annotations: { destructiveHint: true },
|
|
980
1813
|
},
|
|
@@ -996,7 +1829,13 @@ export function createMcpServer(): McpServer {
|
|
|
996
1829
|
);
|
|
997
1830
|
|
|
998
1831
|
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
999
|
-
|
|
1832
|
+
const locked = await refuseLockedEntry(extra, args.collection, resolvedId, args.overrideLock);
|
|
1833
|
+
if (locked) return locked;
|
|
1834
|
+
return unwrapAndInvalidate(
|
|
1835
|
+
extra,
|
|
1836
|
+
await ec.handleContentDiscardDraft(args.collection, resolvedId, { _rev: args._rev }),
|
|
1837
|
+
[args.collection, resolvedId],
|
|
1838
|
+
);
|
|
1000
1839
|
},
|
|
1001
1840
|
);
|
|
1002
1841
|
|
|
@@ -1043,8 +1882,21 @@ export function createMcpServer(): McpServer {
|
|
|
1043
1882
|
async (args, extra) => {
|
|
1044
1883
|
requireScope(extra, "content:write");
|
|
1045
1884
|
requireRole(extra, Role.CONTRIBUTOR);
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1885
|
+
const { emdash, userId } = getExtra(extra);
|
|
1886
|
+
const existing = await emdash.handleContentGet(args.collection, args.id);
|
|
1887
|
+
if (!existing.success) return unwrap(existing);
|
|
1888
|
+
requireOwnership(
|
|
1889
|
+
extra,
|
|
1890
|
+
extractContentAuthorId(existing.data),
|
|
1891
|
+
"content:edit_own",
|
|
1892
|
+
"content:edit_any",
|
|
1893
|
+
);
|
|
1894
|
+
const resolvedId = extractContentId(existing.data) ?? args.id;
|
|
1895
|
+
return unwrapAndInvalidate(
|
|
1896
|
+
extra,
|
|
1897
|
+
await emdash.handleContentDuplicate(args.collection, resolvedId, userId),
|
|
1898
|
+
[args.collection],
|
|
1899
|
+
);
|
|
1048
1900
|
},
|
|
1049
1901
|
);
|
|
1050
1902
|
|
|
@@ -1071,7 +1923,7 @@ export function createMcpServer(): McpServer {
|
|
|
1071
1923
|
if (result.success && !canReadDrafts(extra)) {
|
|
1072
1924
|
const data =
|
|
1073
1925
|
result.data && typeof result.data === "object"
|
|
1074
|
-
? // eslint-disable-next-line typescript
|
|
1926
|
+
? // eslint-disable-next-line typescript/no-unsafe-type-assertion -- handler returns unknown data; narrowed by typeof check
|
|
1075
1927
|
(result.data as Record<string, unknown>)
|
|
1076
1928
|
: undefined;
|
|
1077
1929
|
const translations = Array.isArray(data?.translations) ? data.translations : [];
|
|
@@ -1086,7 +1938,197 @@ export function createMcpServer(): McpServer {
|
|
|
1086
1938
|
);
|
|
1087
1939
|
|
|
1088
1940
|
// =====================================================================
|
|
1089
|
-
//
|
|
1941
|
+
// Byline tools
|
|
1942
|
+
// =====================================================================
|
|
1943
|
+
|
|
1944
|
+
server.registerTool(
|
|
1945
|
+
"byline_list",
|
|
1946
|
+
{
|
|
1947
|
+
title: "List Bylines",
|
|
1948
|
+
description:
|
|
1949
|
+
"List bylines (author/contributor credits) with optional filtering and " +
|
|
1950
|
+
"pagination. Bylines are standalone records referenced by content items; " +
|
|
1951
|
+
"use the returned id with content_create/content_update or byline_get. Use " +
|
|
1952
|
+
"the nextCursor value from the response to fetch the next page.",
|
|
1953
|
+
inputSchema: z.object({
|
|
1954
|
+
search: z.string().optional().describe("Filter by display name or slug substring"),
|
|
1955
|
+
isGuest: z.boolean().optional().describe("Filter by guest (true) or linked-user (false)"),
|
|
1956
|
+
userId: z.string().optional().describe("Filter to the byline linked to a CMS user ID"),
|
|
1957
|
+
locale: z.string().optional().describe("Filter by locale (omit for all)"),
|
|
1958
|
+
limit: z.number().int().min(1).max(100).optional().describe("Max items (default 50)"),
|
|
1959
|
+
cursor: z.string().min(1).max(2048).optional().describe("Pagination cursor"),
|
|
1960
|
+
}),
|
|
1961
|
+
annotations: { readOnlyHint: true },
|
|
1962
|
+
},
|
|
1963
|
+
async (args, extra) => {
|
|
1964
|
+
requireScope(extra, "content:read");
|
|
1965
|
+
const ec = getEmDash(extra);
|
|
1966
|
+
try {
|
|
1967
|
+
const { BylineRepository } = await import("../database/repositories/byline.js");
|
|
1968
|
+
const repo = new BylineRepository(ec.db);
|
|
1969
|
+
return jsonResult(
|
|
1970
|
+
await repo.findMany({
|
|
1971
|
+
search: args.search,
|
|
1972
|
+
isGuest: args.isGuest,
|
|
1973
|
+
userId: args.userId,
|
|
1974
|
+
locale: args.locale,
|
|
1975
|
+
limit: args.limit,
|
|
1976
|
+
cursor: args.cursor,
|
|
1977
|
+
}),
|
|
1978
|
+
);
|
|
1979
|
+
} catch (error) {
|
|
1980
|
+
return respondHandlerError(error, "BYLINE_LIST_ERROR");
|
|
1981
|
+
}
|
|
1982
|
+
},
|
|
1983
|
+
);
|
|
1984
|
+
|
|
1985
|
+
server.registerTool(
|
|
1986
|
+
"byline_get",
|
|
1987
|
+
{
|
|
1988
|
+
title: "Get Byline",
|
|
1989
|
+
description:
|
|
1990
|
+
"Get a single byline by its ID, including bio, avatar, website, linked " +
|
|
1991
|
+
"user, and any custom fields.",
|
|
1992
|
+
inputSchema: z.object({
|
|
1993
|
+
id: z.string().describe("Byline ID"),
|
|
1994
|
+
}),
|
|
1995
|
+
annotations: { readOnlyHint: true },
|
|
1996
|
+
},
|
|
1997
|
+
async (args, extra) => {
|
|
1998
|
+
requireScope(extra, "content:read");
|
|
1999
|
+
const ec = getEmDash(extra);
|
|
2000
|
+
try {
|
|
2001
|
+
const { BylineRepository } = await import("../database/repositories/byline.js");
|
|
2002
|
+
const byline = await new BylineRepository(ec.db).findById(args.id);
|
|
2003
|
+
if (!byline) return respondError("NOT_FOUND", `Byline '${args.id}' not found`);
|
|
2004
|
+
return jsonResult(byline);
|
|
2005
|
+
} catch (error) {
|
|
2006
|
+
return respondHandlerError(error, "BYLINE_GET_ERROR");
|
|
2007
|
+
}
|
|
2008
|
+
},
|
|
2009
|
+
);
|
|
2010
|
+
|
|
2011
|
+
server.registerTool(
|
|
2012
|
+
"byline_create",
|
|
2013
|
+
{
|
|
2014
|
+
title: "Create Byline",
|
|
2015
|
+
description:
|
|
2016
|
+
"Create a new byline (author/contributor credit). The slug must be unique " +
|
|
2017
|
+
"and contain only lowercase letters, digits, and hyphens. Link the byline " +
|
|
2018
|
+
"to a CMS user via userId, or leave it as a standalone guest credit. The " +
|
|
2019
|
+
"returned id can then be passed to content_create/content_update bylines.",
|
|
2020
|
+
inputSchema: z.object({ ...bylineCreateBody.shape }),
|
|
2021
|
+
annotations: { destructiveHint: false },
|
|
2022
|
+
},
|
|
2023
|
+
async (args, extra) => {
|
|
2024
|
+
requireScope(extra, "content:write");
|
|
2025
|
+
requireRole(extra, Role.EDITOR);
|
|
2026
|
+
const ec = getEmDash(extra);
|
|
2027
|
+
try {
|
|
2028
|
+
const { handleBylineCreate } = await import("../api/handlers/bylines.js");
|
|
2029
|
+
const result = await handleBylineCreate(ec.db, args);
|
|
2030
|
+
if (result.success) {
|
|
2031
|
+
await invalidateBylines();
|
|
2032
|
+
const byline = result.data;
|
|
2033
|
+
after(() => ec.hooks.runBylineAfterSave(byline, true));
|
|
2034
|
+
}
|
|
2035
|
+
return unwrap(result);
|
|
2036
|
+
} catch (error) {
|
|
2037
|
+
return respondHandlerError(error, "BYLINE_CREATE_ERROR");
|
|
2038
|
+
}
|
|
2039
|
+
},
|
|
2040
|
+
);
|
|
2041
|
+
|
|
2042
|
+
server.registerTool(
|
|
2043
|
+
"byline_update",
|
|
2044
|
+
{
|
|
2045
|
+
title: "Update Byline",
|
|
2046
|
+
description:
|
|
2047
|
+
"Update an existing byline. Any field can be omitted to leave it " +
|
|
2048
|
+
"unchanged. Renaming the slug must not collide with another byline.",
|
|
2049
|
+
inputSchema: z.object({
|
|
2050
|
+
id: z.string().describe("Byline ID to update"),
|
|
2051
|
+
...bylineUpdateBody.shape,
|
|
2052
|
+
}),
|
|
2053
|
+
},
|
|
2054
|
+
async (args, extra) => {
|
|
2055
|
+
requireScope(extra, "content:write");
|
|
2056
|
+
requireRole(extra, Role.EDITOR);
|
|
2057
|
+
const ec = getEmDash(extra);
|
|
2058
|
+
try {
|
|
2059
|
+
const { handleBylineUpdate } = await import("../api/handlers/bylines.js");
|
|
2060
|
+
const { id, ...input } = args;
|
|
2061
|
+
const result = await handleBylineUpdate(ec.db, id, input);
|
|
2062
|
+
if (result.success) {
|
|
2063
|
+
await invalidateBylines();
|
|
2064
|
+
const byline = result.data;
|
|
2065
|
+
after(() => ec.hooks.runBylineAfterSave(byline, false));
|
|
2066
|
+
}
|
|
2067
|
+
return unwrap(result);
|
|
2068
|
+
} catch (error) {
|
|
2069
|
+
return respondHandlerError(error, "BYLINE_UPDATE_ERROR");
|
|
2070
|
+
}
|
|
2071
|
+
},
|
|
2072
|
+
);
|
|
2073
|
+
|
|
2074
|
+
server.registerTool(
|
|
2075
|
+
"byline_delete",
|
|
2076
|
+
{
|
|
2077
|
+
title: "Delete Byline",
|
|
2078
|
+
description:
|
|
2079
|
+
"Permanently delete a byline. Any content crediting this byline loses the " +
|
|
2080
|
+
"association, and it is cleared as a primary byline where set.",
|
|
2081
|
+
inputSchema: z.object({
|
|
2082
|
+
id: z.string().describe("Byline ID to delete"),
|
|
2083
|
+
}),
|
|
2084
|
+
annotations: { destructiveHint: true },
|
|
2085
|
+
},
|
|
2086
|
+
async (args, extra) => {
|
|
2087
|
+
requireScope(extra, "content:write");
|
|
2088
|
+
requireRole(extra, Role.EDITOR);
|
|
2089
|
+
const ec = getEmDash(extra);
|
|
2090
|
+
try {
|
|
2091
|
+
const { BylineRepository } = await import("../database/repositories/byline.js");
|
|
2092
|
+
const repo = new BylineRepository(ec.db);
|
|
2093
|
+
const existing = ec.hooks.hasHooks("byline:afterDelete")
|
|
2094
|
+
? await repo.findById(args.id)
|
|
2095
|
+
: null;
|
|
2096
|
+
const deleted = await repo.delete(args.id);
|
|
2097
|
+
if (!deleted) return respondError("NOT_FOUND", `Byline '${args.id}' not found`);
|
|
2098
|
+
await invalidateBylines();
|
|
2099
|
+
if (existing) after(() => ec.hooks.runBylineAfterDelete(existing));
|
|
2100
|
+
return jsonResult({ deleted: args.id });
|
|
2101
|
+
} catch (error) {
|
|
2102
|
+
return respondHandlerError(error, "BYLINE_DELETE_ERROR");
|
|
2103
|
+
}
|
|
2104
|
+
},
|
|
2105
|
+
);
|
|
2106
|
+
|
|
2107
|
+
server.registerTool(
|
|
2108
|
+
"byline_translations",
|
|
2109
|
+
{
|
|
2110
|
+
title: "List Byline Translations",
|
|
2111
|
+
description:
|
|
2112
|
+
"Return every locale variant of a byline, identified via its shared translation_group.",
|
|
2113
|
+
inputSchema: z.object({
|
|
2114
|
+
id: z.string().describe("Byline id (or translation_group)"),
|
|
2115
|
+
}),
|
|
2116
|
+
annotations: { readOnlyHint: true },
|
|
2117
|
+
},
|
|
2118
|
+
async (args, extra) => {
|
|
2119
|
+
requireScope(extra, "content:read");
|
|
2120
|
+
const ec = getEmDash(extra);
|
|
2121
|
+
try {
|
|
2122
|
+
const { handleBylineTranslations } = await import("../api/handlers/bylines.js");
|
|
2123
|
+
return unwrap(await handleBylineTranslations(ec.db, args.id));
|
|
2124
|
+
} catch (error) {
|
|
2125
|
+
return respondHandlerError(error, "BYLINE_TRANSLATIONS_ERROR");
|
|
2126
|
+
}
|
|
2127
|
+
},
|
|
2128
|
+
);
|
|
2129
|
+
|
|
2130
|
+
// =====================================================================
|
|
2131
|
+
// Schema tools
|
|
1090
2132
|
// =====================================================================
|
|
1091
2133
|
|
|
1092
2134
|
server.registerTool(
|
|
@@ -1124,7 +2166,8 @@ export function createMcpServer(): McpServer {
|
|
|
1124
2166
|
"Get detailed info about a collection including all field definitions. " +
|
|
1125
2167
|
"Fields describe the data model: name, type (string, text, number, " +
|
|
1126
2168
|
"boolean, datetime, portableText, image, reference, json, select, " +
|
|
1127
|
-
"multiSelect, slug), constraints, and validation rules.
|
|
2169
|
+
"multiSelect, slug, blocks), constraints, and validation rules. Blocks fields " +
|
|
2170
|
+
"include every allowed and retired block type version. Use this to " +
|
|
1128
2171
|
"understand what data content_create and content_update expect.",
|
|
1129
2172
|
inputSchema: z.object({
|
|
1130
2173
|
slug: z
|
|
@@ -1140,19 +2183,114 @@ export function createMcpServer(): McpServer {
|
|
|
1140
2183
|
requireRole(extra, Role.EDITOR);
|
|
1141
2184
|
const ec = getEmDash(extra);
|
|
1142
2185
|
try {
|
|
1143
|
-
const { SchemaRegistry } = await import("../schema/index.js");
|
|
2186
|
+
const { SchemaRegistry, expandCollectionBlockFields } = await import("../schema/index.js");
|
|
1144
2187
|
const registry = new SchemaRegistry(ec.db);
|
|
1145
2188
|
const collection = await registry.getCollectionWithFields(args.slug);
|
|
1146
2189
|
if (!collection) {
|
|
1147
2190
|
return respondError("NOT_FOUND", `Collection '${args.slug}' not found`);
|
|
1148
2191
|
}
|
|
1149
|
-
return jsonResult(collection);
|
|
2192
|
+
return jsonResult(await expandCollectionBlockFields(ec.db, collection));
|
|
1150
2193
|
} catch (error) {
|
|
1151
2194
|
return respondHandlerError(error, "SCHEMA_GET_ERROR");
|
|
1152
2195
|
}
|
|
1153
2196
|
},
|
|
1154
2197
|
);
|
|
1155
2198
|
|
|
2199
|
+
server.registerTool(
|
|
2200
|
+
"schema_list_block_types",
|
|
2201
|
+
{
|
|
2202
|
+
title: "List Block Types",
|
|
2203
|
+
description: "List every database-owned block type and all retained versions.",
|
|
2204
|
+
inputSchema: z.object({}),
|
|
2205
|
+
annotations: { readOnlyHint: true },
|
|
2206
|
+
},
|
|
2207
|
+
async (_args, extra) => {
|
|
2208
|
+
requireScope(extra, "schema:read");
|
|
2209
|
+
requireRole(extra, Role.EDITOR);
|
|
2210
|
+
const ec = getEmDash(extra);
|
|
2211
|
+
const { handleBlockTypeList } = await import("../api/handlers/block-types.js");
|
|
2212
|
+
return unwrap(await handleBlockTypeList(ec.db));
|
|
2213
|
+
},
|
|
2214
|
+
);
|
|
2215
|
+
|
|
2216
|
+
server.registerTool(
|
|
2217
|
+
"schema_get_block_type",
|
|
2218
|
+
{
|
|
2219
|
+
title: "Get Block Type",
|
|
2220
|
+
description: "Get one block type, including active, inactive, and historical versions.",
|
|
2221
|
+
inputSchema: z.object({ slug: z.string().describe("Block type slug") }),
|
|
2222
|
+
annotations: { readOnlyHint: true },
|
|
2223
|
+
},
|
|
2224
|
+
async (args, extra) => {
|
|
2225
|
+
requireScope(extra, "schema:read");
|
|
2226
|
+
requireRole(extra, Role.EDITOR);
|
|
2227
|
+
const ec = getEmDash(extra);
|
|
2228
|
+
const { handleBlockTypeGet } = await import("../api/handlers/block-types.js");
|
|
2229
|
+
return unwrap(await handleBlockTypeGet(ec.db, args.slug));
|
|
2230
|
+
},
|
|
2231
|
+
);
|
|
2232
|
+
|
|
2233
|
+
server.registerTool(
|
|
2234
|
+
"schema_create_block_type",
|
|
2235
|
+
{
|
|
2236
|
+
title: "Create Block Type",
|
|
2237
|
+
description: "Create a block type with active version 1.",
|
|
2238
|
+
inputSchema: z.object(createBlockTypeBody.shape),
|
|
2239
|
+
},
|
|
2240
|
+
async (args, extra) => {
|
|
2241
|
+
requireScope(extra, "schema:write");
|
|
2242
|
+
requireRole(extra, Role.ADMIN);
|
|
2243
|
+
const ec = getEmDash(extra);
|
|
2244
|
+
const { handleBlockTypeCreate } = await import("../api/handlers/block-types.js");
|
|
2245
|
+
return unwrap(await handleBlockTypeCreate(ec.db, args));
|
|
2246
|
+
},
|
|
2247
|
+
);
|
|
2248
|
+
|
|
2249
|
+
server.registerTool(
|
|
2250
|
+
"schema_update_block_type",
|
|
2251
|
+
{
|
|
2252
|
+
title: "Update Block Type",
|
|
2253
|
+
description:
|
|
2254
|
+
"Update presentation or compatible fields in place. Set breaking to create an inactive retained version.",
|
|
2255
|
+
inputSchema: z.object({ slug: z.string(), ...updateBlockTypeBody.shape }),
|
|
2256
|
+
},
|
|
2257
|
+
async (args, extra) => {
|
|
2258
|
+
requireScope(extra, "schema:write");
|
|
2259
|
+
requireRole(extra, Role.ADMIN);
|
|
2260
|
+
const ec = getEmDash(extra);
|
|
2261
|
+
const { slug, ...input } = args;
|
|
2262
|
+
const { handleBlockTypeUpdate } = await import("../api/handlers/block-types.js");
|
|
2263
|
+
return unwrap(await handleBlockTypeUpdate(ec.db, slug, input));
|
|
2264
|
+
},
|
|
2265
|
+
);
|
|
2266
|
+
|
|
2267
|
+
server.registerTool(
|
|
2268
|
+
"schema_activate_block_type_version",
|
|
2269
|
+
{
|
|
2270
|
+
title: "Activate Block Type Version",
|
|
2271
|
+
description: "Make a retained version the active version used by newly created blocks.",
|
|
2272
|
+
inputSchema: z.object({
|
|
2273
|
+
slug: z.string(),
|
|
2274
|
+
version: z.number().int().positive(),
|
|
2275
|
+
expectedFingerprint: z.string().min(1),
|
|
2276
|
+
}),
|
|
2277
|
+
},
|
|
2278
|
+
async (args, extra) => {
|
|
2279
|
+
requireScope(extra, "schema:write");
|
|
2280
|
+
requireRole(extra, Role.ADMIN);
|
|
2281
|
+
const ec = getEmDash(extra);
|
|
2282
|
+
const { handleBlockTypeVersionActivate } = await import("../api/handlers/block-types.js");
|
|
2283
|
+
return unwrap(
|
|
2284
|
+
await handleBlockTypeVersionActivate(
|
|
2285
|
+
ec.db,
|
|
2286
|
+
args.slug,
|
|
2287
|
+
args.version,
|
|
2288
|
+
args.expectedFingerprint,
|
|
2289
|
+
),
|
|
2290
|
+
);
|
|
2291
|
+
},
|
|
2292
|
+
);
|
|
2293
|
+
|
|
1156
2294
|
server.registerTool(
|
|
1157
2295
|
"schema_create_collection",
|
|
1158
2296
|
{
|
|
@@ -1162,7 +2300,8 @@ export function createMcpServer(): McpServer {
|
|
|
1162
2300
|
"table and schema definition. The slug must be lowercase alphanumeric " +
|
|
1163
2301
|
"with underscores, starting with a letter. Supports: 'drafts' (draft/" +
|
|
1164
2302
|
"publish workflow), 'revisions' (version history), 'preview' (live " +
|
|
1165
|
-
"preview), 'scheduling' (timed publish), 'search' (full-text indexing)
|
|
2303
|
+
"preview), 'scheduling' (timed publish), 'search' (full-text indexing), " +
|
|
2304
|
+
"and 'seo' (SEO metadata).",
|
|
1166
2305
|
inputSchema: z.object({
|
|
1167
2306
|
slug: z
|
|
1168
2307
|
.string()
|
|
@@ -1171,11 +2310,19 @@ export function createMcpServer(): McpServer {
|
|
|
1171
2310
|
label: z.string().describe("Display name (plural, e.g. 'Blog Posts')"),
|
|
1172
2311
|
labelSingular: z.string().optional().describe("Singular display name (e.g. 'Blog Post')"),
|
|
1173
2312
|
description: z.string().optional().describe("Description of this collection"),
|
|
1174
|
-
icon:
|
|
1175
|
-
supports:
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
2313
|
+
icon: createCollectionBody.shape.icon.describe("Icon name for the admin UI"),
|
|
2314
|
+
supports: createCollectionBody.shape.supports.describe(
|
|
2315
|
+
"Features to enable (default: ['drafts', 'revisions'])",
|
|
2316
|
+
),
|
|
2317
|
+
routable: createCollectionBody.shape.routable.describe(
|
|
2318
|
+
"Require a slug before publishing (default: true)",
|
|
2319
|
+
),
|
|
2320
|
+
editLocking: createCollectionBody.shape.editLocking.describe(
|
|
2321
|
+
"Take an edit lock when an entry is opened (default: true)",
|
|
2322
|
+
),
|
|
2323
|
+
group: createCollectionBody.shape.group.describe(
|
|
2324
|
+
"Admin sidebar folder shared with other collections of the same group",
|
|
2325
|
+
),
|
|
1179
2326
|
}),
|
|
1180
2327
|
},
|
|
1181
2328
|
async (args, extra) => {
|
|
@@ -1194,8 +2341,11 @@ export function createMcpServer(): McpServer {
|
|
|
1194
2341
|
// SchemaRegistry.createCollection now defaults `supports` to
|
|
1195
2342
|
// ['drafts', 'revisions'] when undefined; pass through verbatim.
|
|
1196
2343
|
supports: args.supports,
|
|
2344
|
+
routable: args.routable,
|
|
2345
|
+
editLocking: args.editLocking,
|
|
2346
|
+
group: args.group,
|
|
1197
2347
|
});
|
|
1198
|
-
ec.
|
|
2348
|
+
ec.invalidateUrlPatternCache();
|
|
1199
2349
|
return jsonResult(collection);
|
|
1200
2350
|
} catch (error) {
|
|
1201
2351
|
return respondHandlerError(error, "SCHEMA_CREATE_ERROR");
|
|
@@ -1227,7 +2377,7 @@ export function createMcpServer(): McpServer {
|
|
|
1227
2377
|
const { SchemaRegistry } = await import("../schema/index.js");
|
|
1228
2378
|
const registry = new SchemaRegistry(ec.db);
|
|
1229
2379
|
await registry.deleteCollection(args.slug, { force: args.force });
|
|
1230
|
-
ec.
|
|
2380
|
+
ec.invalidateUrlPatternCache();
|
|
1231
2381
|
return jsonResult({ deleted: args.slug });
|
|
1232
2382
|
} catch (error) {
|
|
1233
2383
|
return respondHandlerError(error, "SCHEMA_DELETE_ERROR");
|
|
@@ -1235,6 +2385,33 @@ export function createMcpServer(): McpServer {
|
|
|
1235
2385
|
},
|
|
1236
2386
|
);
|
|
1237
2387
|
|
|
2388
|
+
server.registerTool(
|
|
2389
|
+
"schema_update_collection",
|
|
2390
|
+
{
|
|
2391
|
+
title: "Update Collection",
|
|
2392
|
+
description:
|
|
2393
|
+
"Update an existing collection without deleting its table, fields, or content. " +
|
|
2394
|
+
"Only provided settings change; omitted settings keep their current values. " +
|
|
2395
|
+
"The collection slug cannot be changed.",
|
|
2396
|
+
inputSchema: schemaUpdateCollectionToolSchema,
|
|
2397
|
+
annotations: { destructiveHint: false },
|
|
2398
|
+
},
|
|
2399
|
+
async (args, extra) => {
|
|
2400
|
+
requireScope(extra, "schema:write");
|
|
2401
|
+
requireRole(extra, Role.ADMIN);
|
|
2402
|
+
const ec = getEmDash(extra);
|
|
2403
|
+
const { slug, ...input } = args;
|
|
2404
|
+
try {
|
|
2405
|
+
const { handleSchemaCollectionUpdate } = await import("../api/handlers/schema.js");
|
|
2406
|
+
const result = await handleSchemaCollectionUpdate(ec.db, slug, input);
|
|
2407
|
+
if (result.success) ec.invalidateUrlPatternCache();
|
|
2408
|
+
return unwrap(result);
|
|
2409
|
+
} catch (error) {
|
|
2410
|
+
return respondHandlerError(error, "SCHEMA_UPDATE_ERROR");
|
|
2411
|
+
}
|
|
2412
|
+
},
|
|
2413
|
+
);
|
|
2414
|
+
|
|
1238
2415
|
server.registerTool(
|
|
1239
2416
|
"schema_create_field",
|
|
1240
2417
|
{
|
|
@@ -1244,7 +2421,7 @@ export function createMcpServer(): McpServer {
|
|
|
1244
2421
|
"database table. Field types: string (short text), text (long text), " +
|
|
1245
2422
|
"number (decimal), integer, boolean, datetime, select (single choice), " +
|
|
1246
2423
|
"multiSelect (multiple), portableText (rich text), image, file, " +
|
|
1247
|
-
"reference (link to another collection), json, slug (URL-safe id). " +
|
|
2424
|
+
"reference (link to another collection), json, slug (URL-safe id), or blocks. " +
|
|
1248
2425
|
"For select/multiSelect, provide choices in validation.options array.",
|
|
1249
2426
|
inputSchema: z.object({
|
|
1250
2427
|
collection: z.string().describe("Collection slug to add the field to"),
|
|
@@ -1269,6 +2446,7 @@ export function createMcpServer(): McpServer {
|
|
|
1269
2446
|
"reference",
|
|
1270
2447
|
"json",
|
|
1271
2448
|
"slug",
|
|
2449
|
+
"blocks",
|
|
1272
2450
|
])
|
|
1273
2451
|
.describe("Data type for this field"),
|
|
1274
2452
|
required: z.boolean().optional().describe("Whether the field is required (default false)"),
|
|
@@ -1285,6 +2463,12 @@ export function createMcpServer(): McpServer {
|
|
|
1285
2463
|
.array(z.string())
|
|
1286
2464
|
.optional()
|
|
1287
2465
|
.describe("Allowed values for select/multiSelect"),
|
|
2466
|
+
allowedTypes: z
|
|
2467
|
+
.array(z.string())
|
|
2468
|
+
.optional()
|
|
2469
|
+
.describe("Ordered block type slugs allowed by a blocks field"),
|
|
2470
|
+
minItems: z.number().int().min(0).optional(),
|
|
2471
|
+
maxItems: z.number().int().min(1).optional(),
|
|
1288
2472
|
})
|
|
1289
2473
|
.optional()
|
|
1290
2474
|
.describe("Validation constraints"),
|
|
@@ -1296,13 +2480,14 @@ export function createMcpServer(): McpServer {
|
|
|
1296
2480
|
.describe("Target collection slug for reference fields"),
|
|
1297
2481
|
rows: z.number().optional().describe("Number of rows for textarea"),
|
|
1298
2482
|
})
|
|
1299
|
-
.
|
|
2483
|
+
.loose()
|
|
1300
2484
|
.optional()
|
|
1301
2485
|
.describe("Widget configuration"),
|
|
1302
2486
|
searchable: z
|
|
1303
2487
|
.boolean()
|
|
1304
2488
|
.optional()
|
|
1305
2489
|
.describe("Include in full-text search index (default false)"),
|
|
2490
|
+
indexed: z.boolean().optional().describe("Create a physical index for structured sorting"),
|
|
1306
2491
|
translatable: z
|
|
1307
2492
|
.boolean()
|
|
1308
2493
|
.optional()
|
|
@@ -1329,9 +2514,9 @@ export function createMcpServer(): McpServer {
|
|
|
1329
2514
|
validation: args.validation,
|
|
1330
2515
|
options: args.options,
|
|
1331
2516
|
searchable: args.searchable,
|
|
2517
|
+
indexed: args.indexed,
|
|
1332
2518
|
translatable: args.translatable,
|
|
1333
2519
|
});
|
|
1334
|
-
ec.invalidateManifest();
|
|
1335
2520
|
return jsonResult(field);
|
|
1336
2521
|
} catch (error) {
|
|
1337
2522
|
return respondHandlerError(error, "FIELD_CREATE_ERROR");
|
|
@@ -1360,7 +2545,6 @@ export function createMcpServer(): McpServer {
|
|
|
1360
2545
|
const { SchemaRegistry } = await import("../schema/index.js");
|
|
1361
2546
|
const registry = new SchemaRegistry(ec.db);
|
|
1362
2547
|
await registry.deleteField(args.collection, args.fieldSlug);
|
|
1363
|
-
ec.invalidateManifest();
|
|
1364
2548
|
return jsonResult({ deleted: args.fieldSlug, collection: args.collection });
|
|
1365
2549
|
} catch (error) {
|
|
1366
2550
|
return respondHandlerError(error, "FIELD_DELETE_ERROR");
|
|
@@ -1368,6 +2552,31 @@ export function createMcpServer(): McpServer {
|
|
|
1368
2552
|
},
|
|
1369
2553
|
);
|
|
1370
2554
|
|
|
2555
|
+
server.registerTool(
|
|
2556
|
+
"schema_update_field",
|
|
2557
|
+
{
|
|
2558
|
+
title: "Update Field",
|
|
2559
|
+
description:
|
|
2560
|
+
"Update an existing field without deleting its column or stored values. Only " +
|
|
2561
|
+
"provided settings change; omitted settings keep their current values. Changes " +
|
|
2562
|
+
"that require a content or column migration are rejected with migration guidance.",
|
|
2563
|
+
inputSchema: schemaUpdateFieldToolSchema,
|
|
2564
|
+
annotations: { destructiveHint: false },
|
|
2565
|
+
},
|
|
2566
|
+
async (args, extra) => {
|
|
2567
|
+
requireScope(extra, "schema:write");
|
|
2568
|
+
requireRole(extra, Role.ADMIN);
|
|
2569
|
+
const ec = getEmDash(extra);
|
|
2570
|
+
const { collection, fieldSlug, ...input } = args;
|
|
2571
|
+
try {
|
|
2572
|
+
const { handleSchemaFieldUpdate } = await import("../api/handlers/schema.js");
|
|
2573
|
+
return unwrap(await handleSchemaFieldUpdate(ec.db, collection, fieldSlug, input));
|
|
2574
|
+
} catch (error) {
|
|
2575
|
+
return respondHandlerError(error, "SCHEMA_FIELD_UPDATE_ERROR");
|
|
2576
|
+
}
|
|
2577
|
+
},
|
|
2578
|
+
);
|
|
2579
|
+
|
|
1371
2580
|
// =====================================================================
|
|
1372
2581
|
// Media tools
|
|
1373
2582
|
// =====================================================================
|
|
@@ -1406,28 +2615,15 @@ export function createMcpServer(): McpServer {
|
|
|
1406
2615
|
server.registerTool(
|
|
1407
2616
|
"media_create",
|
|
1408
2617
|
{
|
|
1409
|
-
title: "
|
|
2618
|
+
title: "Confirm Signed Media Upload",
|
|
1410
2619
|
description:
|
|
1411
|
-
"
|
|
1412
|
-
"
|
|
1413
|
-
"
|
|
1414
|
-
"
|
|
1415
|
-
"media_list / media_get
|
|
1416
|
-
"uploads the MCP transport is not appropriate — use the signed-upload " +
|
|
1417
|
-
"flow instead.",
|
|
2620
|
+
"Confirm a file after uploading it with a signed URL obtained from " +
|
|
2621
|
+
"POST /_emdash/api/media/upload-url. `storageKey` must be the key returned " +
|
|
2622
|
+
"for the same user. Confirmation checks that the stored file exists and " +
|
|
2623
|
+
"matches the size fixed when the URL was issued, then makes it available " +
|
|
2624
|
+
"through media_list / media_get. To upload through MCP, use media_upload instead.",
|
|
1418
2625
|
inputSchema: z.object({
|
|
1419
|
-
|
|
1420
|
-
mimeType: z.string().describe("MIME type (e.g. 'image/png')"),
|
|
1421
|
-
storageKey: z.string().describe("Storage path/key the file was uploaded to"),
|
|
1422
|
-
size: z.number().int().nonnegative().optional().describe("File size in bytes"),
|
|
1423
|
-
width: z.number().int().positive().optional().describe("Image width in pixels"),
|
|
1424
|
-
height: z.number().int().positive().optional().describe("Image height in pixels"),
|
|
1425
|
-
contentHash: z.string().optional().describe("Hash of the file contents (for dedupe)"),
|
|
1426
|
-
blurhash: z.string().optional().describe("Blurhash for image placeholders"),
|
|
1427
|
-
dominantColor: z
|
|
1428
|
-
.string()
|
|
1429
|
-
.optional()
|
|
1430
|
-
.describe("Hex color string for the image's dominant color"),
|
|
2626
|
+
storageKey: z.string().describe("Storage key returned by the signed upload URL request"),
|
|
1431
2627
|
}),
|
|
1432
2628
|
},
|
|
1433
2629
|
async (args, extra) => {
|
|
@@ -1435,22 +2631,66 @@ export function createMcpServer(): McpServer {
|
|
|
1435
2631
|
requireRole(extra, Role.AUTHOR);
|
|
1436
2632
|
const { emdash, userId } = getExtra(extra);
|
|
1437
2633
|
return unwrap(
|
|
1438
|
-
await emdash.
|
|
1439
|
-
filename: args.filename,
|
|
1440
|
-
mimeType: args.mimeType,
|
|
2634
|
+
await emdash.handleMediaRegisterUpload({
|
|
1441
2635
|
storageKey: args.storageKey,
|
|
1442
|
-
size: args.size,
|
|
1443
|
-
width: args.width,
|
|
1444
|
-
height: args.height,
|
|
1445
|
-
contentHash: args.contentHash,
|
|
1446
|
-
blurhash: args.blurhash,
|
|
1447
|
-
dominantColor: args.dominantColor,
|
|
1448
2636
|
authorId: userId,
|
|
1449
2637
|
}),
|
|
1450
2638
|
);
|
|
1451
2639
|
},
|
|
1452
2640
|
);
|
|
1453
2641
|
|
|
2642
|
+
server.registerTool(
|
|
2643
|
+
"media_upload",
|
|
2644
|
+
{
|
|
2645
|
+
title: "Upload Media",
|
|
2646
|
+
description:
|
|
2647
|
+
"Upload a media file from base64-encoded data and " +
|
|
2648
|
+
"register it in the media library. Returns the media item with id, " +
|
|
2649
|
+
"storageKey, and url — ready to reference from content fields (e.g. " +
|
|
2650
|
+
"featured_image) via content_create / content_update. Uploads are " +
|
|
2651
|
+
"deduplicated by content hash: re-uploading identical bytes returns " +
|
|
2652
|
+
"the existing item with deduplicated: true. Subject to the global " +
|
|
2653
|
+
"upload MIME allowlist and the configured maximum upload size.",
|
|
2654
|
+
inputSchema: z.object({
|
|
2655
|
+
filename: z.string().min(1).describe("Filename including extension (e.g. 'cover.png')"),
|
|
2656
|
+
base64: z.string().describe("Base64-encoded file contents."),
|
|
2657
|
+
contentType: z
|
|
2658
|
+
.string()
|
|
2659
|
+
.regex(CONTENT_TYPE_RE, "Invalid content type")
|
|
2660
|
+
.describe("MIME type (e.g. 'image/png')."),
|
|
2661
|
+
alt: z.string().optional().describe("Alt text for accessibility"),
|
|
2662
|
+
caption: z
|
|
2663
|
+
.string()
|
|
2664
|
+
.optional()
|
|
2665
|
+
.describe("Caption stored on the media record, such as the credit"),
|
|
2666
|
+
}),
|
|
2667
|
+
annotations: { destructiveHint: false },
|
|
2668
|
+
},
|
|
2669
|
+
async (args, extra) => {
|
|
2670
|
+
requireScope(extra, "media:write");
|
|
2671
|
+
requireRole(extra, Role.CONTRIBUTOR);
|
|
2672
|
+
const { emdash, userId } = getExtra(extra);
|
|
2673
|
+
if (!emdash.storage) {
|
|
2674
|
+
return respondError("NO_STORAGE", "Storage not configured");
|
|
2675
|
+
}
|
|
2676
|
+
try {
|
|
2677
|
+
return unwrap(
|
|
2678
|
+
await emdash.handleMediaUpload({
|
|
2679
|
+
filename: args.filename,
|
|
2680
|
+
base64: args.base64,
|
|
2681
|
+
contentType: args.contentType,
|
|
2682
|
+
alt: args.alt,
|
|
2683
|
+
caption: args.caption,
|
|
2684
|
+
authorId: userId,
|
|
2685
|
+
maxUploadSize: emdash.config.maxUploadSize,
|
|
2686
|
+
}),
|
|
2687
|
+
);
|
|
2688
|
+
} catch (error) {
|
|
2689
|
+
return respondHandlerError(error, "UPLOAD_ERROR");
|
|
2690
|
+
}
|
|
2691
|
+
},
|
|
2692
|
+
);
|
|
2693
|
+
|
|
1454
2694
|
server.registerTool(
|
|
1455
2695
|
"media_get",
|
|
1456
2696
|
{
|
|
@@ -1535,83 +2775,289 @@ export function createMcpServer(): McpServer {
|
|
|
1535
2775
|
if (!existing.success) {
|
|
1536
2776
|
return unwrap(existing);
|
|
1537
2777
|
}
|
|
1538
|
-
const media = (existing.data as Record<string, unknown> | undefined)?.item as
|
|
1539
|
-
| Record<string, unknown>
|
|
1540
|
-
| undefined;
|
|
1541
|
-
const authorId = typeof media?.authorId === "string" ? media.authorId : "";
|
|
1542
|
-
requireOwnership(extra, authorId, "media:delete_own", "media:delete_any");
|
|
1543
|
-
|
|
1544
|
-
return unwrap(await ec.handleMediaDelete(args.id));
|
|
2778
|
+
const media = (existing.data as Record<string, unknown> | undefined)?.item as
|
|
2779
|
+
| Record<string, unknown>
|
|
2780
|
+
| undefined;
|
|
2781
|
+
const authorId = typeof media?.authorId === "string" ? media.authorId : "";
|
|
2782
|
+
requireOwnership(extra, authorId, "media:delete_own", "media:delete_any");
|
|
2783
|
+
|
|
2784
|
+
return unwrap(await ec.handleMediaDelete(args.id));
|
|
2785
|
+
},
|
|
2786
|
+
);
|
|
2787
|
+
|
|
2788
|
+
server.registerTool(
|
|
2789
|
+
"media_usage_repair",
|
|
2790
|
+
{
|
|
2791
|
+
title: "Repair Media Usage Index",
|
|
2792
|
+
description:
|
|
2793
|
+
"Repair content media usage indexes for one collection or every collection. " +
|
|
2794
|
+
"Returns complete, partial, failed, or stale status; inspect the structured result.",
|
|
2795
|
+
inputSchema: mediaUsageRepairToolSchema,
|
|
2796
|
+
},
|
|
2797
|
+
async (args, extra) => {
|
|
2798
|
+
requireScope(extra, "admin");
|
|
2799
|
+
requireRole(extra, Role.ADMIN);
|
|
2800
|
+
const ec = getEmDash(extra);
|
|
2801
|
+
|
|
2802
|
+
let input: MediaUsageRepairRequest;
|
|
2803
|
+
if (args.scope === "collection") {
|
|
2804
|
+
if (args.collection === undefined) {
|
|
2805
|
+
return respondError(
|
|
2806
|
+
"VALIDATION_ERROR",
|
|
2807
|
+
"Collection is required when scope is collection",
|
|
2808
|
+
);
|
|
2809
|
+
}
|
|
2810
|
+
input = { scope: "collection", collection: args.collection };
|
|
2811
|
+
} else {
|
|
2812
|
+
input = { scope: "all" };
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
try {
|
|
2816
|
+
const { handleMediaUsageRepair } = await import("../api/handlers/media-usage.js");
|
|
2817
|
+
return unwrap(await handleMediaUsageRepair(ec.db, input));
|
|
2818
|
+
} catch (error) {
|
|
2819
|
+
return respondHandlerError(error, "MEDIA_USAGE_REPAIR_ERROR");
|
|
2820
|
+
}
|
|
2821
|
+
},
|
|
2822
|
+
);
|
|
2823
|
+
|
|
2824
|
+
// =====================================================================
|
|
2825
|
+
// Search tool
|
|
2826
|
+
// =====================================================================
|
|
2827
|
+
|
|
2828
|
+
server.registerTool(
|
|
2829
|
+
"search",
|
|
2830
|
+
{
|
|
2831
|
+
title: "Search Content",
|
|
2832
|
+
description:
|
|
2833
|
+
"Full-text search across content collections. Searches indexed fields " +
|
|
2834
|
+
"for matching content. Collections must have 'search' in their supports " +
|
|
2835
|
+
"list and fields must be marked as searchable. Returns collection, item " +
|
|
2836
|
+
"ID, title, excerpt, and relevance score.",
|
|
2837
|
+
inputSchema: z.object({
|
|
2838
|
+
query: z.string().describe("Search query text"),
|
|
2839
|
+
collections: z
|
|
2840
|
+
.array(z.string())
|
|
2841
|
+
.optional()
|
|
2842
|
+
.describe("Limit search to specific collection slugs (all if omitted)"),
|
|
2843
|
+
locale: z
|
|
2844
|
+
.string()
|
|
2845
|
+
.optional()
|
|
2846
|
+
.describe("Filter results by locale (omit to search all locales)"),
|
|
2847
|
+
limit: z.number().int().min(1).max(50).optional().describe("Max results (default 20)"),
|
|
2848
|
+
cursor: z
|
|
2849
|
+
.string()
|
|
2850
|
+
.min(1)
|
|
2851
|
+
.max(2048)
|
|
2852
|
+
.optional()
|
|
2853
|
+
.describe("Pagination cursor from a previous response"),
|
|
2854
|
+
}),
|
|
2855
|
+
annotations: { readOnlyHint: true },
|
|
2856
|
+
},
|
|
2857
|
+
async (args, extra) => {
|
|
2858
|
+
requireScope(extra, "content:read");
|
|
2859
|
+
const ec = getEmDash(extra);
|
|
2860
|
+
try {
|
|
2861
|
+
const { searchWithDb } = await import("../search/index.js");
|
|
2862
|
+
const results = await searchWithDb(ec.db, args.query, {
|
|
2863
|
+
collections: args.collections,
|
|
2864
|
+
locale: args.locale,
|
|
2865
|
+
limit: args.limit,
|
|
2866
|
+
cursor: args.cursor,
|
|
2867
|
+
});
|
|
2868
|
+
return jsonResult(results);
|
|
2869
|
+
} catch (error) {
|
|
2870
|
+
return respondHandlerError(error, "SEARCH_ERROR");
|
|
2871
|
+
}
|
|
2872
|
+
},
|
|
2873
|
+
);
|
|
2874
|
+
|
|
2875
|
+
// =====================================================================
|
|
2876
|
+
// Taxonomy tools
|
|
2877
|
+
// =====================================================================
|
|
2878
|
+
|
|
2879
|
+
server.registerTool(
|
|
2880
|
+
"taxonomy_list",
|
|
2881
|
+
{
|
|
2882
|
+
title: "List Taxonomies",
|
|
2883
|
+
description:
|
|
2884
|
+
"List all taxonomy definitions (e.g. categories, tags). Taxonomies are " +
|
|
2885
|
+
"classification systems applied to content. Each has a name, label, and " +
|
|
2886
|
+
"can be hierarchical (categories) or flat (tags). Optionally filter by " +
|
|
2887
|
+
"locale.",
|
|
2888
|
+
inputSchema: z.object({
|
|
2889
|
+
locale: z.string().optional().describe("Filter by locale (omit for all)"),
|
|
2890
|
+
}),
|
|
2891
|
+
annotations: { readOnlyHint: true },
|
|
2892
|
+
},
|
|
2893
|
+
async (args, extra) => {
|
|
2894
|
+
requireScope(extra, "content:read");
|
|
2895
|
+
const ec = getEmDash(extra);
|
|
2896
|
+
try {
|
|
2897
|
+
const { handleTaxonomyList } = await import("../api/handlers/taxonomies.js");
|
|
2898
|
+
return unwrap(await handleTaxonomyList(ec.db, { locale: args.locale }));
|
|
2899
|
+
} catch (error) {
|
|
2900
|
+
return respondHandlerError(error, "TAXONOMY_LIST_ERROR");
|
|
2901
|
+
}
|
|
2902
|
+
},
|
|
2903
|
+
);
|
|
2904
|
+
|
|
2905
|
+
server.registerTool(
|
|
2906
|
+
"taxonomy_get",
|
|
2907
|
+
{
|
|
2908
|
+
title: "Get Taxonomy Definition",
|
|
2909
|
+
description:
|
|
2910
|
+
"Get a single taxonomy definition by name. Taxonomy definitions describe " +
|
|
2911
|
+
"a classification system (e.g. categories or tags), which collections " +
|
|
2912
|
+
"it applies to, and whether it is hierarchical. Pass `locale` to resolve " +
|
|
2913
|
+
"a specific translation; otherwise the lowest matching locale is returned.",
|
|
2914
|
+
inputSchema: z.object({
|
|
2915
|
+
name: z.string().describe("Taxonomy name (e.g. 'categories', 'tags')"),
|
|
2916
|
+
locale: z.string().optional().describe("Locale to resolve the definition for"),
|
|
2917
|
+
}),
|
|
2918
|
+
annotations: { readOnlyHint: true },
|
|
2919
|
+
},
|
|
2920
|
+
async (args, extra) => {
|
|
2921
|
+
requireScope(extra, "content:read");
|
|
2922
|
+
const ec = getEmDash(extra);
|
|
2923
|
+
try {
|
|
2924
|
+
const { handleTaxonomyGet } = await import("../api/handlers/taxonomies.js");
|
|
2925
|
+
return unwrap(await handleTaxonomyGet(ec.db, args.name, { locale: args.locale }));
|
|
2926
|
+
} catch (error) {
|
|
2927
|
+
return respondHandlerError(error, "TAXONOMY_GET_ERROR");
|
|
2928
|
+
}
|
|
2929
|
+
},
|
|
2930
|
+
);
|
|
2931
|
+
|
|
2932
|
+
server.registerTool(
|
|
2933
|
+
"taxonomy_create",
|
|
2934
|
+
{
|
|
2935
|
+
title: "Create Taxonomy Definition",
|
|
2936
|
+
description:
|
|
2937
|
+
"Create a taxonomy definition in one locale. `label` and `labelSingular` " +
|
|
2938
|
+
"belong to that locale; `hierarchical` and `collections` belong to the " +
|
|
2939
|
+
"taxonomy and are the same in every locale. `collections` names which " +
|
|
2940
|
+
"content types the taxonomy applies to. A definition for a name that " +
|
|
2941
|
+
"already exists in another locale joins that taxonomy and takes its " +
|
|
2942
|
+
"`hierarchical` and `collections`; passing different values is an error " +
|
|
2943
|
+
"(change them with taxonomy_update).",
|
|
2944
|
+
inputSchema: z.object({
|
|
2945
|
+
name: createTaxonomyDefBody.shape.name.describe(
|
|
2946
|
+
"Taxonomy name (lowercase letters, numbers, underscores)",
|
|
2947
|
+
),
|
|
2948
|
+
label: createTaxonomyDefBody.shape.label.describe("Display name"),
|
|
2949
|
+
labelSingular: createTaxonomyDefBody.shape.labelSingular.describe(
|
|
2950
|
+
"Singular form of the display name",
|
|
2951
|
+
),
|
|
2952
|
+
hierarchical: createTaxonomyDefBody.shape.hierarchical.describe(
|
|
2953
|
+
"Whether the taxonomy supports parent/child terms, in every locale (defaults to false; must match when the taxonomy exists in another locale)",
|
|
2954
|
+
),
|
|
2955
|
+
collections: createTaxonomyDefBody.shape.collections.describe(
|
|
2956
|
+
"Collection slugs this taxonomy applies to, in every locale (defaults to []; must match when the taxonomy exists in another locale)",
|
|
2957
|
+
),
|
|
2958
|
+
locale: z.string().optional().describe("Locale for this definition (e.g. 'fr-fr')"),
|
|
2959
|
+
translationOf: z
|
|
2960
|
+
.string()
|
|
2961
|
+
.optional()
|
|
2962
|
+
.describe("Existing taxonomy definition id to create this locale variant from"),
|
|
2963
|
+
}),
|
|
2964
|
+
},
|
|
2965
|
+
async (args, extra) => {
|
|
2966
|
+
requireScope(extra, "taxonomies:manage");
|
|
2967
|
+
requireRole(extra, Role.EDITOR);
|
|
2968
|
+
const ec = getEmDash(extra);
|
|
2969
|
+
try {
|
|
2970
|
+
const { handleTaxonomyCreate } = await import("../api/handlers/taxonomies.js");
|
|
2971
|
+
return unwrapAndInvalidate(
|
|
2972
|
+
extra,
|
|
2973
|
+
await handleTaxonomyCreate(ec.db, {
|
|
2974
|
+
name: args.name,
|
|
2975
|
+
label: args.label,
|
|
2976
|
+
labelSingular: args.labelSingular,
|
|
2977
|
+
hierarchical: args.hierarchical,
|
|
2978
|
+
collections: args.collections,
|
|
2979
|
+
locale: args.locale,
|
|
2980
|
+
translationOf: args.translationOf,
|
|
2981
|
+
}),
|
|
2982
|
+
[taxonomyTag(args.name)],
|
|
2983
|
+
);
|
|
2984
|
+
} catch (error) {
|
|
2985
|
+
return respondHandlerError(error, "TAXONOMY_CREATE_ERROR");
|
|
2986
|
+
}
|
|
1545
2987
|
},
|
|
1546
2988
|
);
|
|
1547
2989
|
|
|
1548
|
-
// =====================================================================
|
|
1549
|
-
// Search tool
|
|
1550
|
-
// =====================================================================
|
|
1551
|
-
|
|
1552
2990
|
server.registerTool(
|
|
1553
|
-
"
|
|
2991
|
+
"taxonomy_update",
|
|
1554
2992
|
{
|
|
1555
|
-
title: "
|
|
2993
|
+
title: "Update Taxonomy Definition",
|
|
1556
2994
|
description:
|
|
1557
|
-
"
|
|
1558
|
-
"
|
|
1559
|
-
"
|
|
1560
|
-
"
|
|
2995
|
+
"Update an existing taxonomy definition. The taxonomy `name` cannot be " +
|
|
2996
|
+
"changed. Pass `locale` to update a specific translation's `label` and " +
|
|
2997
|
+
"`labelSingular`; otherwise the lowest matching locale is updated. " +
|
|
2998
|
+
"`hierarchical` and `collections` change for every locale. Any field " +
|
|
2999
|
+
"may be omitted to leave it unchanged.",
|
|
1561
3000
|
inputSchema: z.object({
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
3001
|
+
name: z.string().describe("Taxonomy name to update"),
|
|
3002
|
+
label: updateTaxonomyDefBody.shape.label.describe("New display name"),
|
|
3003
|
+
labelSingular: updateTaxonomyDefBody.shape.labelSingular.describe(
|
|
3004
|
+
"New singular display name; pass null to clear",
|
|
3005
|
+
),
|
|
3006
|
+
hierarchical: updateTaxonomyDefBody.shape.hierarchical.describe(
|
|
3007
|
+
"Whether the taxonomy supports parent/child terms, in every locale",
|
|
3008
|
+
),
|
|
3009
|
+
collections: updateTaxonomyDefBody.shape.collections.describe(
|
|
3010
|
+
"Collection slugs this taxonomy applies to, in every locale",
|
|
3011
|
+
),
|
|
3012
|
+
locale: z.string().optional().describe("Locale of the definition to update"),
|
|
1572
3013
|
}),
|
|
1573
|
-
annotations: { readOnlyHint: true },
|
|
1574
3014
|
},
|
|
1575
3015
|
async (args, extra) => {
|
|
1576
|
-
requireScope(extra, "
|
|
3016
|
+
requireScope(extra, "taxonomies:manage");
|
|
3017
|
+
requireRole(extra, Role.EDITOR);
|
|
1577
3018
|
const ec = getEmDash(extra);
|
|
1578
3019
|
try {
|
|
1579
|
-
const {
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
3020
|
+
const { handleTaxonomyUpdate } = await import("../api/handlers/taxonomies.js");
|
|
3021
|
+
return unwrapAndInvalidate(
|
|
3022
|
+
extra,
|
|
3023
|
+
await handleTaxonomyUpdate(ec.db, args.name, {
|
|
3024
|
+
label: args.label,
|
|
3025
|
+
labelSingular: args.labelSingular,
|
|
3026
|
+
hierarchical: args.hierarchical,
|
|
3027
|
+
collections: args.collections,
|
|
3028
|
+
locale: args.locale,
|
|
3029
|
+
}),
|
|
3030
|
+
[taxonomyTag(args.name)],
|
|
3031
|
+
);
|
|
1586
3032
|
} catch (error) {
|
|
1587
|
-
return respondHandlerError(error, "
|
|
3033
|
+
return respondHandlerError(error, "TAXONOMY_UPDATE_ERROR");
|
|
1588
3034
|
}
|
|
1589
3035
|
},
|
|
1590
3036
|
);
|
|
1591
3037
|
|
|
1592
|
-
// =====================================================================
|
|
1593
|
-
// Taxonomy tools
|
|
1594
|
-
// =====================================================================
|
|
1595
|
-
|
|
1596
3038
|
server.registerTool(
|
|
1597
|
-
"
|
|
3039
|
+
"taxonomy_delete",
|
|
1598
3040
|
{
|
|
1599
|
-
title: "
|
|
3041
|
+
title: "Delete Taxonomy Definition",
|
|
1600
3042
|
description:
|
|
1601
|
-
"
|
|
1602
|
-
"
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
3043
|
+
"Delete a taxonomy definition and all of its terms in every locale, " +
|
|
3044
|
+
"along with any content assignments those terms hold. This cannot be undone.",
|
|
3045
|
+
inputSchema: z.object({
|
|
3046
|
+
name: z.string().describe("Taxonomy name to delete"),
|
|
3047
|
+
}),
|
|
3048
|
+
annotations: { destructiveHint: true },
|
|
1606
3049
|
},
|
|
1607
|
-
async (
|
|
1608
|
-
requireScope(extra, "
|
|
3050
|
+
async (args, extra) => {
|
|
3051
|
+
requireScope(extra, "taxonomies:manage");
|
|
3052
|
+
requireRole(extra, Role.EDITOR);
|
|
1609
3053
|
const ec = getEmDash(extra);
|
|
1610
3054
|
try {
|
|
1611
|
-
const {
|
|
1612
|
-
return
|
|
3055
|
+
const { handleTaxonomyDelete } = await import("../api/handlers/taxonomies.js");
|
|
3056
|
+
return unwrapAndInvalidate(extra, await handleTaxonomyDelete(ec.db, args.name), [
|
|
3057
|
+
taxonomyTag(args.name),
|
|
3058
|
+
]);
|
|
1613
3059
|
} catch (error) {
|
|
1614
|
-
return respondHandlerError(error, "
|
|
3060
|
+
return respondHandlerError(error, "TAXONOMY_DELETE_ERROR");
|
|
1615
3061
|
}
|
|
1616
3062
|
},
|
|
1617
3063
|
);
|
|
@@ -1627,7 +3073,13 @@ export function createMcpServer(): McpServer {
|
|
|
1627
3073
|
inputSchema: z.object({
|
|
1628
3074
|
taxonomy: z.string().describe("Taxonomy name (e.g. 'categories', 'tags')"),
|
|
1629
3075
|
limit: z.number().int().min(1).max(100).optional().describe("Max items (default 50)"),
|
|
1630
|
-
cursor: z
|
|
3076
|
+
cursor: z
|
|
3077
|
+
.string()
|
|
3078
|
+
.min(1)
|
|
3079
|
+
.max(MAX_TAXONOMY_CURSOR_LENGTH)
|
|
3080
|
+
.optional()
|
|
3081
|
+
.describe("Pagination cursor"),
|
|
3082
|
+
locale: z.string().optional().describe("Filter by locale (omit for all)"),
|
|
1631
3083
|
}),
|
|
1632
3084
|
annotations: { readOnlyHint: true },
|
|
1633
3085
|
},
|
|
@@ -1635,9 +3087,8 @@ export function createMcpServer(): McpServer {
|
|
|
1635
3087
|
requireScope(extra, "content:read");
|
|
1636
3088
|
const ec = getEmDash(extra);
|
|
1637
3089
|
try {
|
|
1638
|
-
// Verify taxonomy exists via handler layer
|
|
1639
3090
|
const { handleTaxonomyList } = await import("../api/handlers/taxonomies.js");
|
|
1640
|
-
const listResult = await handleTaxonomyList(ec.db);
|
|
3091
|
+
const listResult = await handleTaxonomyList(ec.db, { locale: args.locale });
|
|
1641
3092
|
if (!listResult.success) return unwrap(listResult);
|
|
1642
3093
|
|
|
1643
3094
|
const taxonomies = (listResult.data as { taxonomies: Array<{ name: string; id?: string }> })
|
|
@@ -1645,54 +3096,56 @@ export function createMcpServer(): McpServer {
|
|
|
1645
3096
|
const taxonomy = taxonomies.find((t: { name: string }) => t.name === args.taxonomy);
|
|
1646
3097
|
if (!taxonomy) return respondError("NOT_FOUND", `Taxonomy '${args.taxonomy}' not found`);
|
|
1647
3098
|
|
|
1648
|
-
// Paginated term query via repository (avoids N+1 of handleTermList)
|
|
1649
3099
|
const { TaxonomyRepository } = await import("../database/repositories/taxonomy.js");
|
|
1650
|
-
const { decodeCursor, encodeCursor, InvalidCursorError } =
|
|
1651
|
-
await import("../database/repositories/types.js");
|
|
1652
3100
|
const repo = new TaxonomyRepository(ec.db);
|
|
1653
|
-
const limit = Math.min(args.limit ?? 50, 100);
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
// Manual keyset pagination over the sorted-by-label results.
|
|
1657
|
-
// Using a base64-encoded `(label, id)` cursor matches the
|
|
1658
|
-
// scheme other list endpoints use and tolerates concurrent
|
|
1659
|
-
// deletion of the cursor-term — the cursor is a position,
|
|
1660
|
-
// not a row reference, so a missing row just means we skip
|
|
1661
|
-
// past it rather than erroring.
|
|
1662
|
-
let startIdx = 0;
|
|
3101
|
+
const limit = Math.max(1, Math.min(args.limit ?? 50, 100));
|
|
3102
|
+
let cursor: TaxonomyListCursor | undefined;
|
|
1663
3103
|
if (args.cursor) {
|
|
1664
|
-
let decoded: { orderValue: string; id: string };
|
|
1665
3104
|
try {
|
|
1666
|
-
|
|
3105
|
+
cursor = decodeTaxonomyCursor(args.cursor);
|
|
1667
3106
|
} catch (error) {
|
|
1668
3107
|
if (error instanceof InvalidCursorError) {
|
|
1669
3108
|
return respondError("INVALID_CURSOR", error.message);
|
|
1670
3109
|
}
|
|
1671
3110
|
throw error;
|
|
1672
3111
|
}
|
|
1673
|
-
// Find the first term that sorts strictly after the cursor
|
|
1674
|
-
// position. Stable order is `(label asc, id asc)` so a
|
|
1675
|
-
// `(label, id)` tuple comparison is the keyset.
|
|
1676
|
-
startIdx = terms.findIndex(
|
|
1677
|
-
(t) =>
|
|
1678
|
-
t.label > decoded.orderValue || (t.label === decoded.orderValue && t.id > decoded.id),
|
|
1679
|
-
);
|
|
1680
|
-
if (startIdx < 0) startIdx = terms.length;
|
|
1681
3112
|
}
|
|
1682
3113
|
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
3114
|
+
let pageCursor: { sortOrder: number; label: string; id: string } | undefined;
|
|
3115
|
+
if (cursor) {
|
|
3116
|
+
const cursorTerm = await repo.findById(cursor.id);
|
|
3117
|
+
if (
|
|
3118
|
+
!cursorTerm ||
|
|
3119
|
+
cursorTerm.name !== args.taxonomy ||
|
|
3120
|
+
(args.locale !== undefined && cursorTerm.locale !== args.locale)
|
|
3121
|
+
) {
|
|
3122
|
+
return respondError("INVALID_CURSOR", "Pagination cursor no longer identifies a term");
|
|
3123
|
+
}
|
|
3124
|
+
pageCursor = {
|
|
3125
|
+
sortOrder: cursorTerm.sortOrder,
|
|
3126
|
+
label: cursorTerm.label,
|
|
3127
|
+
id: cursorTerm.id,
|
|
3128
|
+
};
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
const page = await repo.findPageByName(args.taxonomy, {
|
|
3132
|
+
locale: args.locale,
|
|
3133
|
+
limit,
|
|
3134
|
+
...(pageCursor ? { cursor: pageCursor } : {}),
|
|
3135
|
+
});
|
|
3136
|
+
const last = page.items.at(-1);
|
|
3137
|
+
const nextCursor = page.hasMore && last ? encodeTaxonomyCursor(last) : undefined;
|
|
1687
3138
|
|
|
1688
3139
|
return jsonResult({
|
|
1689
|
-
items: page.map((t) => ({
|
|
3140
|
+
items: page.items.map((t) => ({
|
|
1690
3141
|
id: t.id,
|
|
1691
3142
|
name: t.name,
|
|
1692
3143
|
slug: t.slug,
|
|
1693
3144
|
label: t.label,
|
|
1694
3145
|
parentId: t.parentId,
|
|
1695
3146
|
description: typeof t.data?.description === "string" ? t.data.description : undefined,
|
|
3147
|
+
locale: t.locale,
|
|
3148
|
+
translationGroup: t.translationGroup,
|
|
1696
3149
|
})),
|
|
1697
3150
|
nextCursor,
|
|
1698
3151
|
});
|
|
@@ -1714,10 +3167,21 @@ export function createMcpServer(): McpServer {
|
|
|
1714
3167
|
"new term beneath a chain of 100+ existing ancestors are rejected.",
|
|
1715
3168
|
inputSchema: z.object({
|
|
1716
3169
|
taxonomy: z.string().describe("Taxonomy name (e.g. 'categories', 'tags')"),
|
|
1717
|
-
slug: z
|
|
3170
|
+
slug: z
|
|
3171
|
+
.string()
|
|
3172
|
+
.min(1)
|
|
3173
|
+
.optional()
|
|
3174
|
+
.describe("URL identifier for the term; omit to derive it from the label"),
|
|
1718
3175
|
label: z.string().describe("Display name"),
|
|
1719
3176
|
parentId: z.string().optional().describe("Parent term ID for hierarchical taxonomies"),
|
|
1720
3177
|
description: z.string().optional().describe("Description of the term"),
|
|
3178
|
+
locale: z.string().optional().describe("Locale for the new term (e.g. 'es')"),
|
|
3179
|
+
translationOf: z
|
|
3180
|
+
.string()
|
|
3181
|
+
.optional()
|
|
3182
|
+
.describe(
|
|
3183
|
+
"Term id to join as a translation (same translation_group). The new term takes that term's parent and position; a different parentId moves the term in every locale",
|
|
3184
|
+
),
|
|
1721
3185
|
}),
|
|
1722
3186
|
},
|
|
1723
3187
|
async (args, extra) => {
|
|
@@ -1726,13 +3190,17 @@ export function createMcpServer(): McpServer {
|
|
|
1726
3190
|
const ec = getEmDash(extra);
|
|
1727
3191
|
try {
|
|
1728
3192
|
const { handleTermCreate } = await import("../api/handlers/taxonomies.js");
|
|
1729
|
-
return
|
|
3193
|
+
return unwrapAndInvalidate(
|
|
3194
|
+
extra,
|
|
1730
3195
|
await handleTermCreate(ec.db, args.taxonomy, {
|
|
1731
3196
|
slug: args.slug,
|
|
1732
3197
|
label: args.label,
|
|
1733
3198
|
parentId: args.parentId,
|
|
1734
3199
|
description: args.description,
|
|
3200
|
+
locale: args.locale,
|
|
3201
|
+
translationOf: args.translationOf,
|
|
1735
3202
|
}),
|
|
3203
|
+
[taxonomyTag(args.taxonomy)],
|
|
1736
3204
|
);
|
|
1737
3205
|
} catch (error) {
|
|
1738
3206
|
return respondHandlerError(error, "TAXONOMY_TERM_CREATE_ERROR");
|
|
@@ -1751,7 +3219,9 @@ export function createMcpServer(): McpServer {
|
|
|
1751
3219
|
"parent must exist, belong to the same taxonomy, and not introduce a cycle " +
|
|
1752
3220
|
"(a term cannot be its own ancestor). The new parent's ancestor chain must " +
|
|
1753
3221
|
"not exceed 100 levels — reparenting under a chain of 100+ ancestors is " +
|
|
1754
|
-
"rejected."
|
|
3222
|
+
"rejected. Translations of a term can share a slug: pass `locale` to " +
|
|
3223
|
+
"update a specific translation; otherwise the lowest matching locale is " +
|
|
3224
|
+
"updated.",
|
|
1755
3225
|
inputSchema: z.object({
|
|
1756
3226
|
taxonomy: z.string().describe("Taxonomy name (e.g. 'categories', 'tags')"),
|
|
1757
3227
|
termSlug: z.string().describe("Current slug of the term to update"),
|
|
@@ -1759,6 +3229,7 @@ export function createMcpServer(): McpServer {
|
|
|
1759
3229
|
label: z.string().optional().describe("New display name"),
|
|
1760
3230
|
parentId: z.string().nullable().optional().describe("New parent term ID; null to detach"),
|
|
1761
3231
|
description: z.string().optional().describe("New description"),
|
|
3232
|
+
locale: z.string().optional().describe("Locale of the term to update (e.g. 'fr')"),
|
|
1762
3233
|
}),
|
|
1763
3234
|
},
|
|
1764
3235
|
async (args, extra) => {
|
|
@@ -1767,13 +3238,21 @@ export function createMcpServer(): McpServer {
|
|
|
1767
3238
|
const ec = getEmDash(extra);
|
|
1768
3239
|
try {
|
|
1769
3240
|
const { handleTermUpdate } = await import("../api/handlers/taxonomies.js");
|
|
1770
|
-
return
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
3241
|
+
return unwrapAndInvalidate(
|
|
3242
|
+
extra,
|
|
3243
|
+
await handleTermUpdate(
|
|
3244
|
+
ec.db,
|
|
3245
|
+
args.taxonomy,
|
|
3246
|
+
args.termSlug,
|
|
3247
|
+
{
|
|
3248
|
+
slug: args.slug,
|
|
3249
|
+
label: args.label,
|
|
3250
|
+
parentId: args.parentId,
|
|
3251
|
+
description: args.description,
|
|
3252
|
+
},
|
|
3253
|
+
{ locale: args.locale },
|
|
3254
|
+
),
|
|
3255
|
+
[taxonomyTag(args.taxonomy)],
|
|
1777
3256
|
);
|
|
1778
3257
|
} catch (error) {
|
|
1779
3258
|
return respondHandlerError(error, "TAXONOMY_TERM_UPDATE_ERROR");
|
|
@@ -1788,10 +3267,13 @@ export function createMcpServer(): McpServer {
|
|
|
1788
3267
|
description:
|
|
1789
3268
|
"Permanently delete a term from a taxonomy. Any content tagged with this " +
|
|
1790
3269
|
"term loses the association. Cannot delete a term that has children — " +
|
|
1791
|
-
"delete children first."
|
|
3270
|
+
"delete children first. Translations of a term can share a slug: pass " +
|
|
3271
|
+
"`locale` to delete a specific translation; otherwise the lowest matching " +
|
|
3272
|
+
"locale is deleted.",
|
|
1792
3273
|
inputSchema: z.object({
|
|
1793
3274
|
taxonomy: z.string().describe("Taxonomy name"),
|
|
1794
3275
|
termSlug: z.string().describe("Slug of the term to delete"),
|
|
3276
|
+
locale: z.string().optional().describe("Locale of the term to delete (e.g. 'fr')"),
|
|
1795
3277
|
}),
|
|
1796
3278
|
annotations: { destructiveHint: true },
|
|
1797
3279
|
},
|
|
@@ -1801,13 +3283,40 @@ export function createMcpServer(): McpServer {
|
|
|
1801
3283
|
const ec = getEmDash(extra);
|
|
1802
3284
|
try {
|
|
1803
3285
|
const { handleTermDelete } = await import("../api/handlers/taxonomies.js");
|
|
1804
|
-
return
|
|
3286
|
+
return unwrapAndInvalidate(
|
|
3287
|
+
extra,
|
|
3288
|
+
await handleTermDelete(ec.db, args.taxonomy, args.termSlug, { locale: args.locale }),
|
|
3289
|
+
[taxonomyTag(args.taxonomy)],
|
|
3290
|
+
);
|
|
1805
3291
|
} catch (error) {
|
|
1806
3292
|
return respondHandlerError(error, "TAXONOMY_TERM_DELETE_ERROR");
|
|
1807
3293
|
}
|
|
1808
3294
|
},
|
|
1809
3295
|
);
|
|
1810
3296
|
|
|
3297
|
+
server.registerTool(
|
|
3298
|
+
"taxonomy_term_translations",
|
|
3299
|
+
{
|
|
3300
|
+
title: "List Term Translations",
|
|
3301
|
+
description:
|
|
3302
|
+
"Return every locale variant of a taxonomy term, identified via its shared translation_group.",
|
|
3303
|
+
inputSchema: z.object({
|
|
3304
|
+
id: z.string().describe("Term id (or translation_group)"),
|
|
3305
|
+
}),
|
|
3306
|
+
annotations: { readOnlyHint: true },
|
|
3307
|
+
},
|
|
3308
|
+
async (args, extra) => {
|
|
3309
|
+
requireScope(extra, "content:read");
|
|
3310
|
+
const ec = getEmDash(extra);
|
|
3311
|
+
try {
|
|
3312
|
+
const { handleTermTranslations } = await import("../api/handlers/taxonomies.js");
|
|
3313
|
+
return unwrap(await handleTermTranslations(ec.db, args.id));
|
|
3314
|
+
} catch (error) {
|
|
3315
|
+
return respondHandlerError(error, "TERM_TRANSLATIONS_ERROR");
|
|
3316
|
+
}
|
|
3317
|
+
},
|
|
3318
|
+
);
|
|
3319
|
+
|
|
1811
3320
|
// =====================================================================
|
|
1812
3321
|
// Menu tools
|
|
1813
3322
|
// =====================================================================
|
|
@@ -1817,18 +3326,20 @@ export function createMcpServer(): McpServer {
|
|
|
1817
3326
|
{
|
|
1818
3327
|
title: "List Menus",
|
|
1819
3328
|
description:
|
|
1820
|
-
"List
|
|
1821
|
-
"
|
|
1822
|
-
"
|
|
1823
|
-
inputSchema: z.object({
|
|
3329
|
+
"List navigation menus. Menus are per-locale: filter by `locale` to " +
|
|
3330
|
+
"get just one locale's worth, or omit to list every row (one per " +
|
|
3331
|
+
"locale per menu name).",
|
|
3332
|
+
inputSchema: z.object({
|
|
3333
|
+
locale: z.string().optional().describe("Filter by locale (omit for all)"),
|
|
3334
|
+
}),
|
|
1824
3335
|
annotations: { readOnlyHint: true },
|
|
1825
3336
|
},
|
|
1826
|
-
async (
|
|
3337
|
+
async (args, extra) => {
|
|
1827
3338
|
requireScope(extra, "content:read");
|
|
1828
3339
|
const ec = getEmDash(extra);
|
|
1829
3340
|
try {
|
|
1830
3341
|
const { handleMenuList } = await import("../api/handlers/menus.js");
|
|
1831
|
-
return unwrap(await handleMenuList(ec.db));
|
|
3342
|
+
return unwrap(await handleMenuList(ec.db, { locale: args.locale }));
|
|
1832
3343
|
} catch (error) {
|
|
1833
3344
|
return respondHandlerError(error, "MENU_LIST_ERROR");
|
|
1834
3345
|
}
|
|
@@ -1840,11 +3351,11 @@ export function createMcpServer(): McpServer {
|
|
|
1840
3351
|
{
|
|
1841
3352
|
title: "Get Menu with Items",
|
|
1842
3353
|
description:
|
|
1843
|
-
"Get a menu by name including
|
|
1844
|
-
"
|
|
1845
|
-
"for nesting.",
|
|
3354
|
+
"Get a menu by name, including its items. When multiple locales exist, " +
|
|
3355
|
+
"pass `locale` to pick the right one.",
|
|
1846
3356
|
inputSchema: z.object({
|
|
1847
3357
|
name: z.string().describe("Menu name (e.g. 'main', 'footer')"),
|
|
3358
|
+
locale: z.string().optional().describe("Locale to resolve the menu for"),
|
|
1848
3359
|
}),
|
|
1849
3360
|
annotations: { readOnlyHint: true },
|
|
1850
3361
|
},
|
|
@@ -1853,13 +3364,36 @@ export function createMcpServer(): McpServer {
|
|
|
1853
3364
|
const ec = getEmDash(extra);
|
|
1854
3365
|
try {
|
|
1855
3366
|
const { handleMenuGet } = await import("../api/handlers/menus.js");
|
|
1856
|
-
return unwrap(await handleMenuGet(ec.db, args.name));
|
|
3367
|
+
return unwrap(await handleMenuGet(ec.db, args.name, { locale: args.locale }));
|
|
1857
3368
|
} catch (error) {
|
|
1858
3369
|
return respondHandlerError(error, "MENU_GET_ERROR");
|
|
1859
3370
|
}
|
|
1860
3371
|
},
|
|
1861
3372
|
);
|
|
1862
3373
|
|
|
3374
|
+
server.registerTool(
|
|
3375
|
+
"menu_translations",
|
|
3376
|
+
{
|
|
3377
|
+
title: "List Menu Translations",
|
|
3378
|
+
description:
|
|
3379
|
+
"Return every locale variant of a menu, identified via the shared translation_group.",
|
|
3380
|
+
inputSchema: z.object({
|
|
3381
|
+
id: z.string().describe("Menu id (or translation_group)"),
|
|
3382
|
+
}),
|
|
3383
|
+
annotations: { readOnlyHint: true },
|
|
3384
|
+
},
|
|
3385
|
+
async (args, extra) => {
|
|
3386
|
+
requireScope(extra, "content:read");
|
|
3387
|
+
const ec = getEmDash(extra);
|
|
3388
|
+
try {
|
|
3389
|
+
const { handleMenuTranslations } = await import("../api/handlers/menus.js");
|
|
3390
|
+
return unwrap(await handleMenuTranslations(ec.db, args.id));
|
|
3391
|
+
} catch (error) {
|
|
3392
|
+
return respondHandlerError(error, "MENU_TRANSLATIONS_ERROR");
|
|
3393
|
+
}
|
|
3394
|
+
},
|
|
3395
|
+
);
|
|
3396
|
+
|
|
1863
3397
|
server.registerTool(
|
|
1864
3398
|
"menu_create",
|
|
1865
3399
|
{
|
|
@@ -1867,13 +3401,23 @@ export function createMcpServer(): McpServer {
|
|
|
1867
3401
|
description:
|
|
1868
3402
|
"Create a new navigation menu. The `name` is the stable identifier used " +
|
|
1869
3403
|
"by site templates (e.g. 'main', 'footer'); `label` is the human-readable " +
|
|
1870
|
-
"name shown in the admin.
|
|
3404
|
+
"name shown in the admin. Menus are per-locale, so pass `locale` when " +
|
|
3405
|
+
"the same menu name exists in multiple translations. Add items afterwards " +
|
|
3406
|
+
"with menu_set_items. If `translationOf` is set, `locale` must also be set.",
|
|
3407
|
+
// `locale`-when-`translationOf` is enforced inside handleMenuCreate
|
|
3408
|
+
// so REST/SDK callers get the same guard. The description above
|
|
3409
|
+
// documents the rule; the handler returns VALIDATION_ERROR.
|
|
1871
3410
|
inputSchema: z.object({
|
|
1872
3411
|
name: z
|
|
1873
3412
|
.string()
|
|
1874
3413
|
.regex(COLLECTION_SLUG_PATTERN)
|
|
1875
3414
|
.describe("Stable identifier (lowercase letters, numbers, underscores)"),
|
|
1876
3415
|
label: z.string().describe("Display name for the admin"),
|
|
3416
|
+
locale: z.string().optional().describe("Locale for this menu (e.g. 'fr-fr')"),
|
|
3417
|
+
translationOf: z
|
|
3418
|
+
.string()
|
|
3419
|
+
.optional()
|
|
3420
|
+
.describe("Existing menu id to create this locale variant from"),
|
|
1877
3421
|
}),
|
|
1878
3422
|
},
|
|
1879
3423
|
async (args, extra) => {
|
|
@@ -1882,7 +3426,16 @@ export function createMcpServer(): McpServer {
|
|
|
1882
3426
|
const ec = getEmDash(extra);
|
|
1883
3427
|
try {
|
|
1884
3428
|
const { handleMenuCreate } = await import("../api/handlers/menus.js");
|
|
1885
|
-
return
|
|
3429
|
+
return unwrapAndInvalidate(
|
|
3430
|
+
extra,
|
|
3431
|
+
await handleMenuCreate(ec.db, {
|
|
3432
|
+
name: args.name,
|
|
3433
|
+
label: args.label,
|
|
3434
|
+
locale: args.locale,
|
|
3435
|
+
translationOf: args.translationOf,
|
|
3436
|
+
}),
|
|
3437
|
+
[menuTag(args.name)],
|
|
3438
|
+
);
|
|
1886
3439
|
} catch (error) {
|
|
1887
3440
|
return respondHandlerError(error, "MENU_CREATE_ERROR");
|
|
1888
3441
|
}
|
|
@@ -1893,10 +3446,13 @@ export function createMcpServer(): McpServer {
|
|
|
1893
3446
|
"menu_update",
|
|
1894
3447
|
{
|
|
1895
3448
|
title: "Update Menu",
|
|
1896
|
-
description:
|
|
3449
|
+
description:
|
|
3450
|
+
"Update a menu's label. The `name` (stable identifier) cannot be changed. " +
|
|
3451
|
+
"On multi-locale installs, pass `locale` so the correct translation is updated.",
|
|
1897
3452
|
inputSchema: z.object({
|
|
1898
3453
|
name: z.string().describe("Menu name to update"),
|
|
1899
3454
|
label: z.string().describe("New display label"),
|
|
3455
|
+
locale: z.string().optional().describe("Locale of the menu to update"),
|
|
1900
3456
|
}),
|
|
1901
3457
|
},
|
|
1902
3458
|
async (args, extra) => {
|
|
@@ -1905,7 +3461,11 @@ export function createMcpServer(): McpServer {
|
|
|
1905
3461
|
const ec = getEmDash(extra);
|
|
1906
3462
|
try {
|
|
1907
3463
|
const { handleMenuUpdate } = await import("../api/handlers/menus.js");
|
|
1908
|
-
return
|
|
3464
|
+
return unwrapAndInvalidate(
|
|
3465
|
+
extra,
|
|
3466
|
+
await handleMenuUpdate(ec.db, args.name, { label: args.label, locale: args.locale }),
|
|
3467
|
+
[menuTag(args.name)],
|
|
3468
|
+
);
|
|
1909
3469
|
} catch (error) {
|
|
1910
3470
|
return respondHandlerError(error, "MENU_UPDATE_ERROR");
|
|
1911
3471
|
}
|
|
@@ -1916,9 +3476,12 @@ export function createMcpServer(): McpServer {
|
|
|
1916
3476
|
"menu_delete",
|
|
1917
3477
|
{
|
|
1918
3478
|
title: "Delete Menu",
|
|
1919
|
-
description:
|
|
3479
|
+
description:
|
|
3480
|
+
"Delete a menu. Items are also removed. Cannot be undone. On multi-locale " +
|
|
3481
|
+
"installs, pass `locale` so only the intended translation is removed.",
|
|
1920
3482
|
inputSchema: z.object({
|
|
1921
3483
|
name: z.string().describe("Menu name to delete"),
|
|
3484
|
+
locale: z.string().optional().describe("Locale of the menu to delete"),
|
|
1922
3485
|
}),
|
|
1923
3486
|
annotations: { destructiveHint: true },
|
|
1924
3487
|
},
|
|
@@ -1928,7 +3491,11 @@ export function createMcpServer(): McpServer {
|
|
|
1928
3491
|
const ec = getEmDash(extra);
|
|
1929
3492
|
try {
|
|
1930
3493
|
const { handleMenuDelete } = await import("../api/handlers/menus.js");
|
|
1931
|
-
return
|
|
3494
|
+
return unwrapAndInvalidate(
|
|
3495
|
+
extra,
|
|
3496
|
+
await handleMenuDelete(ec.db, args.name, { locale: args.locale }),
|
|
3497
|
+
[menuTag(args.name)],
|
|
3498
|
+
);
|
|
1932
3499
|
} catch (error) {
|
|
1933
3500
|
return respondHandlerError(error, "MENU_DELETE_ERROR");
|
|
1934
3501
|
}
|
|
@@ -1943,9 +3510,11 @@ export function createMcpServer(): McpServer {
|
|
|
1943
3510
|
"Replace the entire item list of a menu in one call. This is atomic: the " +
|
|
1944
3511
|
"existing items are deleted and the new list is inserted in the order " +
|
|
1945
3512
|
"provided. Use this rather than per-item add/remove tools so the resulting " +
|
|
1946
|
-
"order and parent links are unambiguous."
|
|
3513
|
+
"order and parent links are unambiguous. On multi-locale installs, pass " +
|
|
3514
|
+
"`locale` so only the intended translation is rewritten.",
|
|
1947
3515
|
inputSchema: z.object({
|
|
1948
3516
|
name: z.string().describe("Menu name to update"),
|
|
3517
|
+
locale: z.string().optional().describe("Locale of the menu to rewrite"),
|
|
1949
3518
|
items: z
|
|
1950
3519
|
.array(
|
|
1951
3520
|
z.object({
|
|
@@ -1989,7 +3558,11 @@ export function createMcpServer(): McpServer {
|
|
|
1989
3558
|
const ec = getEmDash(extra);
|
|
1990
3559
|
try {
|
|
1991
3560
|
const { handleMenuSetItems } = await import("../api/handlers/menus.js");
|
|
1992
|
-
return
|
|
3561
|
+
return unwrapAndInvalidate(
|
|
3562
|
+
extra,
|
|
3563
|
+
await handleMenuSetItems(ec.db, args.name, args.items, { locale: args.locale }),
|
|
3564
|
+
[menuTag(args.name)],
|
|
3565
|
+
);
|
|
1993
3566
|
} catch (error) {
|
|
1994
3567
|
return respondHandlerError(error, "MENU_SET_ITEMS_ERROR");
|
|
1995
3568
|
}
|
|
@@ -2037,6 +3610,7 @@ export function createMcpServer(): McpServer {
|
|
|
2037
3610
|
"use content_publish afterward if needed.",
|
|
2038
3611
|
inputSchema: z.object({
|
|
2039
3612
|
revisionId: z.string().describe("Revision ID to restore"),
|
|
3613
|
+
overrideLock: z.boolean().optional().describe(OVERRIDE_LOCK_PARAM_DESCRIPTION),
|
|
2040
3614
|
}),
|
|
2041
3615
|
},
|
|
2042
3616
|
async (args, extra) => {
|
|
@@ -2069,6 +3643,14 @@ export function createMcpServer(): McpServer {
|
|
|
2069
3643
|
"content:edit_any",
|
|
2070
3644
|
);
|
|
2071
3645
|
|
|
3646
|
+
const locked = await refuseLockedEntry(
|
|
3647
|
+
extra,
|
|
3648
|
+
revItem.collection,
|
|
3649
|
+
revItem.entryId,
|
|
3650
|
+
args.overrideLock,
|
|
3651
|
+
);
|
|
3652
|
+
if (locked) return locked;
|
|
3653
|
+
|
|
2072
3654
|
return unwrap(await emdash.handleRevisionRestore(args.revisionId, userId));
|
|
2073
3655
|
},
|
|
2074
3656
|
);
|
|
@@ -2112,22 +3694,21 @@ export function createMcpServer(): McpServer {
|
|
|
2112
3694
|
"the full settings object after the update. To set a media reference " +
|
|
2113
3695
|
"(logo, favicon, seo.defaultOgImage), pass an object with `mediaId` " +
|
|
2114
3696
|
"(and optional `alt`) — the media item must already exist (use " +
|
|
2115
|
-
"media_create first).",
|
|
3697
|
+
"media_create first), or pass null to remove it.",
|
|
2116
3698
|
inputSchema: z.object({
|
|
2117
3699
|
title: z.string().optional().describe("Site title"),
|
|
2118
3700
|
tagline: z.string().optional().describe("Site tagline / short description"),
|
|
2119
3701
|
logo: settingsMediaReferenceSchema
|
|
3702
|
+
.nullable()
|
|
2120
3703
|
.optional()
|
|
2121
|
-
.describe("Logo media reference ({ mediaId, alt? })"),
|
|
3704
|
+
.describe("Logo media reference ({ mediaId, alt? }); null removes it"),
|
|
2122
3705
|
favicon: settingsMediaReferenceSchema
|
|
3706
|
+
.nullable()
|
|
2123
3707
|
.optional()
|
|
2124
|
-
.describe("Favicon media reference ({ mediaId, alt? })"),
|
|
3708
|
+
.describe("Favicon media reference ({ mediaId, alt? }); null removes it"),
|
|
2125
3709
|
url: z
|
|
2126
3710
|
.union([
|
|
2127
|
-
z
|
|
2128
|
-
.string()
|
|
2129
|
-
.url()
|
|
2130
|
-
.refine((u) => HTTP_SCHEME_PATTERN.test(u), "URL must use http or https"),
|
|
3711
|
+
z.url().refine((u) => HTTP_SCHEME_PATTERN.test(u), "URL must use http or https"),
|
|
2131
3712
|
z.literal(""),
|
|
2132
3713
|
])
|
|
2133
3714
|
.optional()
|
|
@@ -2151,12 +3732,224 @@ export function createMcpServer(): McpServer {
|
|
|
2151
3732
|
const ec = getEmDash(extra);
|
|
2152
3733
|
try {
|
|
2153
3734
|
const { handleSettingsUpdate } = await import("../api/handlers/settings.js");
|
|
2154
|
-
return
|
|
3735
|
+
return unwrapAndInvalidate(extra, await handleSettingsUpdate(ec.db, ec.storage, args), [
|
|
3736
|
+
siteSettingsTag(),
|
|
3737
|
+
]);
|
|
2155
3738
|
} catch (error) {
|
|
2156
3739
|
return respondHandlerError(error, "SETTINGS_UPDATE_ERROR");
|
|
2157
3740
|
}
|
|
2158
3741
|
},
|
|
2159
3742
|
);
|
|
2160
3743
|
|
|
3744
|
+
// =====================================================================
|
|
3745
|
+
// Site transfer tools
|
|
3746
|
+
// =====================================================================
|
|
3747
|
+
|
|
3748
|
+
server.registerTool(
|
|
3749
|
+
"site_transfer_capabilities",
|
|
3750
|
+
{
|
|
3751
|
+
title: "Get Site Transfer Capabilities",
|
|
3752
|
+
description:
|
|
3753
|
+
"Site package format versions, features, and limits this site supports, and whether " +
|
|
3754
|
+
"it can receive an import (its portable content is empty) with the reasons it cannot. " +
|
|
3755
|
+
"Requires any transfer scope (transfer:export, transfer:analyze, or transfer:execute).",
|
|
3756
|
+
inputSchema: z.object({}),
|
|
3757
|
+
annotations: { readOnlyHint: true },
|
|
3758
|
+
},
|
|
3759
|
+
async (_args, extra) => {
|
|
3760
|
+
requireRole(extra, Role.ADMIN);
|
|
3761
|
+
requireTransferScope(extra, "transfer:*");
|
|
3762
|
+
return unwrap(await transferCapabilities(transferContext(extra)));
|
|
3763
|
+
},
|
|
3764
|
+
);
|
|
3765
|
+
|
|
3766
|
+
server.registerTool(
|
|
3767
|
+
"site_export_start",
|
|
3768
|
+
{
|
|
3769
|
+
title: "Start Site Export",
|
|
3770
|
+
description:
|
|
3771
|
+
"Start exporting the whole site as a portable site package (schema, content, media, " +
|
|
3772
|
+
"settings; never users, credentials, or secrets). Returns the operation id and " +
|
|
3773
|
+
"status only; drive it with site_export_status. The package itself is downloaded " +
|
|
3774
|
+
"outside MCP, from the admin or the CLI. Requires the transfer:export scope. " +
|
|
3775
|
+
APPROVAL_FLOW_DESCRIPTION,
|
|
3776
|
+
inputSchema: z.object({
|
|
3777
|
+
comments: z.boolean().optional().describe("Include comments and reactions (default true)"),
|
|
3778
|
+
approvalId: transferApprovalIdSchema.optional(),
|
|
3779
|
+
}),
|
|
3780
|
+
},
|
|
3781
|
+
async (args, extra) => {
|
|
3782
|
+
requireRole(extra, Role.ADMIN);
|
|
3783
|
+
const scoped = transferScopeHeld(extra, "transfer:export");
|
|
3784
|
+
const { userId, tokenId } = getExtra(extra);
|
|
3785
|
+
return unwrap(
|
|
3786
|
+
await startExport(transferContext(extra), { userId, tokenId }, { ...args, scoped }),
|
|
3787
|
+
);
|
|
3788
|
+
},
|
|
3789
|
+
);
|
|
3790
|
+
|
|
3791
|
+
server.registerTool(
|
|
3792
|
+
"site_export_status",
|
|
3793
|
+
{
|
|
3794
|
+
title: "Get Site Export Status",
|
|
3795
|
+
description:
|
|
3796
|
+
"Report an export's state, stage, and progress, and once it is complete its package " +
|
|
3797
|
+
"digest and record and media totals. By default each call also runs one bounded " +
|
|
3798
|
+
"export step, so call it repeatedly until nextRequestInMs is null; pass advance: " +
|
|
3799
|
+
"false to only read. Requires the transfer:export scope, or the approval that " +
|
|
3800
|
+
"started this export (same token).",
|
|
3801
|
+
inputSchema: z.object({
|
|
3802
|
+
operationId: transferOperationIdSchema,
|
|
3803
|
+
advance: z
|
|
3804
|
+
.boolean()
|
|
3805
|
+
.optional()
|
|
3806
|
+
.describe("Run one bounded export step before reporting (default true)"),
|
|
3807
|
+
}),
|
|
3808
|
+
},
|
|
3809
|
+
async (args, extra) => {
|
|
3810
|
+
requireRole(extra, Role.ADMIN);
|
|
3811
|
+
await requireTransferAccess(extra, "transfer:export", "export", args.operationId);
|
|
3812
|
+
return unwrap(
|
|
3813
|
+
await exportStatus(transferContext(extra), {
|
|
3814
|
+
operationId: args.operationId,
|
|
3815
|
+
advance: args.advance ?? true,
|
|
3816
|
+
}),
|
|
3817
|
+
);
|
|
3818
|
+
},
|
|
3819
|
+
);
|
|
3820
|
+
|
|
3821
|
+
server.registerTool(
|
|
3822
|
+
"site_import_analyze",
|
|
3823
|
+
{
|
|
3824
|
+
title: "Analyze Site Import",
|
|
3825
|
+
description:
|
|
3826
|
+
"Validate an uploaded site package against this site and produce an import plan. " +
|
|
3827
|
+
"The package must already be uploaded over HTTP, from the admin or the CLI; MCP " +
|
|
3828
|
+
"never carries package bytes. Each call runs one bounded analysis step: repeat until " +
|
|
3829
|
+
"nextRequestInMs is null, then read plan (counts, principals with suggested user " +
|
|
3830
|
+
"mappings, warnings, blockers, packageDigest, planDigest). Pass decisions to map " +
|
|
3831
|
+
"principals or keep this site's title and tagline; that produces a new planDigest. " +
|
|
3832
|
+
"Principal emails are never returned. Writes no site content. Requires the " +
|
|
3833
|
+
"transfer:analyze scope.",
|
|
3834
|
+
inputSchema: z.object({
|
|
3835
|
+
operationId: transferOperationIdSchema,
|
|
3836
|
+
decisions: siteImportDecisionsInputSchema
|
|
3837
|
+
.optional()
|
|
3838
|
+
.describe(
|
|
3839
|
+
"principalMappings (principal id to target user id, or null to drop the " +
|
|
3840
|
+
"reference) and siteTitle / siteTagline ('package' or 'target'). Omitted " +
|
|
3841
|
+
"values keep the plan defaults.",
|
|
3842
|
+
),
|
|
3843
|
+
}),
|
|
3844
|
+
},
|
|
3845
|
+
async (args, extra) => {
|
|
3846
|
+
requireRole(extra, Role.ADMIN);
|
|
3847
|
+
requireTransferScope(extra, "transfer:analyze");
|
|
3848
|
+
return unwrap(await analyzeImport(transferContext(extra), args));
|
|
3849
|
+
},
|
|
3850
|
+
);
|
|
3851
|
+
|
|
3852
|
+
server.registerTool(
|
|
3853
|
+
"site_import_start",
|
|
3854
|
+
{
|
|
3855
|
+
title: "Start Site Import",
|
|
3856
|
+
description:
|
|
3857
|
+
"Start importing an analyzed package into this site. packageDigest and planDigest " +
|
|
3858
|
+
"must be the values from the latest site_import_analyze plan, which must have no " +
|
|
3859
|
+
"blockers. Returns the operation id and status; drive it with site_import_resume. " +
|
|
3860
|
+
"The site refuses ordinary content writes until the import completes or an admin " +
|
|
3861
|
+
"abandons it. Requires the transfer:execute scope. " +
|
|
3862
|
+
APPROVAL_FLOW_DESCRIPTION,
|
|
3863
|
+
inputSchema: z.object({
|
|
3864
|
+
operationId: transferOperationIdSchema,
|
|
3865
|
+
packageDigest: z
|
|
3866
|
+
.string()
|
|
3867
|
+
.regex(SHA256_DIGEST_PATTERN, "Expected sha256:<64 hex>")
|
|
3868
|
+
.describe("Package digest from the plan"),
|
|
3869
|
+
planDigest: z
|
|
3870
|
+
.string()
|
|
3871
|
+
.regex(SHA256_DIGEST_PATTERN, "Expected sha256:<64 hex>")
|
|
3872
|
+
.describe("Plan digest from the latest analysis"),
|
|
3873
|
+
approvalId: transferApprovalIdSchema.optional(),
|
|
3874
|
+
}),
|
|
3875
|
+
annotations: { destructiveHint: true },
|
|
3876
|
+
},
|
|
3877
|
+
async (args, extra) => {
|
|
3878
|
+
requireRole(extra, Role.ADMIN);
|
|
3879
|
+
const scoped = transferScopeHeld(extra, "transfer:execute");
|
|
3880
|
+
const { userId, tokenId } = getExtra(extra);
|
|
3881
|
+
return unwrap(
|
|
3882
|
+
await startImport(
|
|
3883
|
+
transferContext(extra),
|
|
3884
|
+
{ userId, tokenId },
|
|
3885
|
+
{
|
|
3886
|
+
operationId: args.operationId,
|
|
3887
|
+
packageDigest: transferDigest(args.packageDigest),
|
|
3888
|
+
planDigest: transferDigest(args.planDigest),
|
|
3889
|
+
approvalId: args.approvalId,
|
|
3890
|
+
scoped,
|
|
3891
|
+
},
|
|
3892
|
+
),
|
|
3893
|
+
);
|
|
3894
|
+
},
|
|
3895
|
+
);
|
|
3896
|
+
|
|
3897
|
+
server.registerTool(
|
|
3898
|
+
"site_import_status",
|
|
3899
|
+
{
|
|
3900
|
+
title: "Get Site Import Status",
|
|
3901
|
+
description:
|
|
3902
|
+
"Report an import's state, stage, progress, digests, and uploaded file counts. Does " +
|
|
3903
|
+
"not advance the import. Requires any transfer scope, or the approval that started " +
|
|
3904
|
+
"this import (same token).",
|
|
3905
|
+
inputSchema: z.object({ operationId: transferOperationIdSchema }),
|
|
3906
|
+
annotations: { readOnlyHint: true },
|
|
3907
|
+
},
|
|
3908
|
+
async (args, extra) => {
|
|
3909
|
+
requireRole(extra, Role.ADMIN);
|
|
3910
|
+
await requireTransferAccess(extra, "transfer:*", "import", args.operationId);
|
|
3911
|
+
return unwrap(await importStatus(transferContext(extra), args.operationId));
|
|
3912
|
+
},
|
|
3913
|
+
);
|
|
3914
|
+
|
|
3915
|
+
server.registerTool(
|
|
3916
|
+
"site_import_resume",
|
|
3917
|
+
{
|
|
3918
|
+
title: "Resume Site Import",
|
|
3919
|
+
description:
|
|
3920
|
+
"Run one bounded step of a started import and report its status. Call repeatedly " +
|
|
3921
|
+
"until nextRequestInMs is null; safe to repeat after a disconnect. Requires the " +
|
|
3922
|
+
"transfer:execute scope, or the approval that started this import (same token).",
|
|
3923
|
+
inputSchema: z.object({ operationId: transferOperationIdSchema }),
|
|
3924
|
+
},
|
|
3925
|
+
async (args, extra) => {
|
|
3926
|
+
requireRole(extra, Role.ADMIN);
|
|
3927
|
+
await requireTransferAccess(extra, "transfer:execute", "import", args.operationId);
|
|
3928
|
+
const { userId, tokenId } = getExtra(extra);
|
|
3929
|
+
return unwrap(
|
|
3930
|
+
await resumeImport(transferContext(extra), { userId, tokenId }, args.operationId),
|
|
3931
|
+
);
|
|
3932
|
+
},
|
|
3933
|
+
);
|
|
3934
|
+
|
|
3935
|
+
server.registerTool(
|
|
3936
|
+
"site_import_receipt",
|
|
3937
|
+
{
|
|
3938
|
+
title: "Get Site Import Receipt",
|
|
3939
|
+
description:
|
|
3940
|
+
"Return the verified receipt of a completed import: package and plan digests, " +
|
|
3941
|
+
"origin and target site ids, logical digest, record counts, warnings, and the " +
|
|
3942
|
+
"receipt's own digest. Requires any transfer scope, or the approval that started " +
|
|
3943
|
+
"this import (same token).",
|
|
3944
|
+
inputSchema: z.object({ operationId: transferOperationIdSchema }),
|
|
3945
|
+
annotations: { readOnlyHint: true },
|
|
3946
|
+
},
|
|
3947
|
+
async (args, extra) => {
|
|
3948
|
+
requireRole(extra, Role.ADMIN);
|
|
3949
|
+
await requireTransferAccess(extra, "transfer:*", "import", args.operationId);
|
|
3950
|
+
return unwrap(await importReceipt(transferContext(extra), args.operationId));
|
|
3951
|
+
},
|
|
3952
|
+
);
|
|
3953
|
+
|
|
2161
3954
|
return server;
|
|
2162
3955
|
}
|