@aotter/mantle-runtime 0.0.11-alpha.11
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/LICENSE +202 -0
- package/README.md +14 -0
- package/dist/domain/index.d.ts +4 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +4 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/model/EntryRow.d.ts +59 -0
- package/dist/domain/model/EntryRow.d.ts.map +1 -0
- package/dist/domain/model/EntryRow.js +42 -0
- package/dist/domain/model/EntryRow.js.map +1 -0
- package/dist/domain/model/HandlerContext.d.ts +65 -0
- package/dist/domain/model/HandlerContext.d.ts.map +1 -0
- package/dist/domain/model/HandlerContext.js +2 -0
- package/dist/domain/model/HandlerContext.js.map +1 -0
- package/dist/domain/model/SeoMeta.d.ts +49 -0
- package/dist/domain/model/SeoMeta.d.ts.map +1 -0
- package/dist/domain/model/SeoMeta.js +2 -0
- package/dist/domain/model/SeoMeta.js.map +1 -0
- package/dist/domain/model/TemplateRegistry.d.ts +47 -0
- package/dist/domain/model/TemplateRegistry.d.ts.map +1 -0
- package/dist/domain/model/TemplateRegistry.js +17 -0
- package/dist/domain/model/TemplateRegistry.js.map +1 -0
- package/dist/domain/model/index.d.ts +7 -0
- package/dist/domain/model/index.d.ts.map +1 -0
- package/dist/domain/model/index.js +6 -0
- package/dist/domain/model/index.js.map +1 -0
- package/dist/domain/port/AssetServer.d.ts +21 -0
- package/dist/domain/port/AssetServer.d.ts.map +1 -0
- package/dist/domain/port/AssetServer.js +2 -0
- package/dist/domain/port/AssetServer.js.map +1 -0
- package/dist/domain/port/Clock.d.ts +13 -0
- package/dist/domain/port/Clock.d.ts.map +1 -0
- package/dist/domain/port/Clock.js +2 -0
- package/dist/domain/port/Clock.js.map +1 -0
- package/dist/domain/port/DatabaseDriver.d.ts +91 -0
- package/dist/domain/port/DatabaseDriver.d.ts.map +1 -0
- package/dist/domain/port/DatabaseDriver.js +2 -0
- package/dist/domain/port/DatabaseDriver.js.map +1 -0
- package/dist/domain/port/DeferredHookDispatcher.d.ts +55 -0
- package/dist/domain/port/DeferredHookDispatcher.d.ts.map +1 -0
- package/dist/domain/port/DeferredHookDispatcher.js +16 -0
- package/dist/domain/port/DeferredHookDispatcher.js.map +1 -0
- package/dist/domain/port/EmailSender.d.ts +31 -0
- package/dist/domain/port/EmailSender.d.ts.map +1 -0
- package/dist/domain/port/EmailSender.js +2 -0
- package/dist/domain/port/EmailSender.js.map +1 -0
- package/dist/domain/port/EntryRepository.d.ts +132 -0
- package/dist/domain/port/EntryRepository.d.ts.map +1 -0
- package/dist/domain/port/EntryRepository.js +2 -0
- package/dist/domain/port/EntryRepository.js.map +1 -0
- package/dist/domain/port/HandlerRegistry.d.ts +38 -0
- package/dist/domain/port/HandlerRegistry.d.ts.map +1 -0
- package/dist/domain/port/HandlerRegistry.js +27 -0
- package/dist/domain/port/HandlerRegistry.js.map +1 -0
- package/dist/domain/port/IdGenerator.d.ts +28 -0
- package/dist/domain/port/IdGenerator.d.ts.map +1 -0
- package/dist/domain/port/IdGenerator.js +5 -0
- package/dist/domain/port/IdGenerator.js.map +1 -0
- package/dist/domain/port/KvCache.d.ts +34 -0
- package/dist/domain/port/KvCache.d.ts.map +1 -0
- package/dist/domain/port/KvCache.js +2 -0
- package/dist/domain/port/KvCache.js.map +1 -0
- package/dist/domain/port/LifecycleHookRunner.d.ts +41 -0
- package/dist/domain/port/LifecycleHookRunner.d.ts.map +1 -0
- package/dist/domain/port/LifecycleHookRunner.js +2 -0
- package/dist/domain/port/LifecycleHookRunner.js.map +1 -0
- package/dist/domain/port/MediaStorage.d.ts +102 -0
- package/dist/domain/port/MediaStorage.d.ts.map +1 -0
- package/dist/domain/port/MediaStorage.js +2 -0
- package/dist/domain/port/MediaStorage.js.map +1 -0
- package/dist/domain/port/PublishOrchestrator.d.ts +25 -0
- package/dist/domain/port/PublishOrchestrator.d.ts.map +1 -0
- package/dist/domain/port/PublishOrchestrator.js +2 -0
- package/dist/domain/port/PublishOrchestrator.js.map +1 -0
- package/dist/domain/port/SiteConfigRepository.d.ts +27 -0
- package/dist/domain/port/SiteConfigRepository.d.ts.map +1 -0
- package/dist/domain/port/SiteConfigRepository.js +2 -0
- package/dist/domain/port/SiteConfigRepository.js.map +1 -0
- package/dist/domain/port/index.d.ts +30 -0
- package/dist/domain/port/index.d.ts.map +1 -0
- package/dist/domain/port/index.js +5 -0
- package/dist/domain/port/index.js.map +1 -0
- package/dist/domain/service/AbsoluteUrl.d.ts +6 -0
- package/dist/domain/service/AbsoluteUrl.d.ts.map +1 -0
- package/dist/domain/service/AbsoluteUrl.js +33 -0
- package/dist/domain/service/AbsoluteUrl.js.map +1 -0
- package/dist/domain/service/AuthPredicateEvaluator.d.ts +29 -0
- package/dist/domain/service/AuthPredicateEvaluator.d.ts.map +1 -0
- package/dist/domain/service/AuthPredicateEvaluator.js +48 -0
- package/dist/domain/service/AuthPredicateEvaluator.js.map +1 -0
- package/dist/domain/service/BuiltinProjector.d.ts +50 -0
- package/dist/domain/service/BuiltinProjector.d.ts.map +1 -0
- package/dist/domain/service/BuiltinProjector.js +61 -0
- package/dist/domain/service/BuiltinProjector.js.map +1 -0
- package/dist/domain/service/EntrySeoSupport.d.ts +27 -0
- package/dist/domain/service/EntrySeoSupport.d.ts.map +1 -0
- package/dist/domain/service/EntrySeoSupport.js +13 -0
- package/dist/domain/service/EntrySeoSupport.js.map +1 -0
- package/dist/domain/service/HtmlRenderer.d.ts +32 -0
- package/dist/domain/service/HtmlRenderer.d.ts.map +1 -0
- package/dist/domain/service/HtmlRenderer.js +38 -0
- package/dist/domain/service/HtmlRenderer.js.map +1 -0
- package/dist/domain/service/LocaleNegotiator.d.ts +29 -0
- package/dist/domain/service/LocaleNegotiator.d.ts.map +1 -0
- package/dist/domain/service/LocaleNegotiator.js +62 -0
- package/dist/domain/service/LocaleNegotiator.js.map +1 -0
- package/dist/domain/service/MarkdownSerializer.d.ts +48 -0
- package/dist/domain/service/MarkdownSerializer.d.ts.map +1 -0
- package/dist/domain/service/MarkdownSerializer.js +109 -0
- package/dist/domain/service/MarkdownSerializer.js.map +1 -0
- package/dist/domain/service/McpToolNaming.d.ts +12 -0
- package/dist/domain/service/McpToolNaming.d.ts.map +1 -0
- package/dist/domain/service/McpToolNaming.js +14 -0
- package/dist/domain/service/McpToolNaming.js.map +1 -0
- package/dist/domain/service/Pagination.d.ts +15 -0
- package/dist/domain/service/Pagination.d.ts.map +1 -0
- package/dist/domain/service/Pagination.js +29 -0
- package/dist/domain/service/Pagination.js.map +1 -0
- package/dist/domain/service/PathMatcher.d.ts +15 -0
- package/dist/domain/service/PathMatcher.d.ts.map +1 -0
- package/dist/domain/service/PathMatcher.js +54 -0
- package/dist/domain/service/PathMatcher.js.map +1 -0
- package/dist/domain/service/PreviewBanner.d.ts +10 -0
- package/dist/domain/service/PreviewBanner.d.ts.map +1 -0
- package/dist/domain/service/PreviewBanner.js +37 -0
- package/dist/domain/service/PreviewBanner.js.map +1 -0
- package/dist/domain/service/PublicPathResolver.d.ts +41 -0
- package/dist/domain/service/PublicPathResolver.d.ts.map +1 -0
- package/dist/domain/service/PublicPathResolver.js +24 -0
- package/dist/domain/service/PublicPathResolver.js.map +1 -0
- package/dist/domain/service/PublishKeys.d.ts +42 -0
- package/dist/domain/service/PublishKeys.d.ts.map +1 -0
- package/dist/domain/service/PublishKeys.js +69 -0
- package/dist/domain/service/PublishKeys.js.map +1 -0
- package/dist/domain/service/SeoMetaComposer.d.ts +47 -0
- package/dist/domain/service/SeoMetaComposer.d.ts.map +1 -0
- package/dist/domain/service/SeoMetaComposer.js +174 -0
- package/dist/domain/service/SeoMetaComposer.js.map +1 -0
- package/dist/domain/service/SitemapSerializer.d.ts +19 -0
- package/dist/domain/service/SitemapSerializer.d.ts.map +1 -0
- package/dist/domain/service/SitemapSerializer.js +27 -0
- package/dist/domain/service/SitemapSerializer.js.map +1 -0
- package/dist/domain/service/TriggerIndex.d.ts +27 -0
- package/dist/domain/service/TriggerIndex.d.ts.map +1 -0
- package/dist/domain/service/TriggerIndex.js +52 -0
- package/dist/domain/service/TriggerIndex.js.map +1 -0
- package/dist/domain/service/ViewParamCoercer.d.ts +20 -0
- package/dist/domain/service/ViewParamCoercer.d.ts.map +1 -0
- package/dist/domain/service/ViewParamCoercer.js +82 -0
- package/dist/domain/service/ViewParamCoercer.js.map +1 -0
- package/dist/domain/service/ViewSqlCompiler.d.ts +29 -0
- package/dist/domain/service/ViewSqlCompiler.d.ts.map +1 -0
- package/dist/domain/service/ViewSqlCompiler.js +147 -0
- package/dist/domain/service/ViewSqlCompiler.js.map +1 -0
- package/dist/domain/service/index.d.ts +28 -0
- package/dist/domain/service/index.d.ts.map +1 -0
- package/dist/domain/service/index.js +28 -0
- package/dist/domain/service/index.js.map +1 -0
- package/dist/domain/service/io/EntryWriteGuard.d.ts +19 -0
- package/dist/domain/service/io/EntryWriteGuard.d.ts.map +1 -0
- package/dist/domain/service/io/EntryWriteGuard.js +109 -0
- package/dist/domain/service/io/EntryWriteGuard.js.map +1 -0
- package/dist/domain/service/io/JoinedEntryReader.d.ts +33 -0
- package/dist/domain/service/io/JoinedEntryReader.d.ts.map +1 -0
- package/dist/domain/service/io/JoinedEntryReader.js +95 -0
- package/dist/domain/service/io/JoinedEntryReader.js.map +1 -0
- package/dist/domain/service/io/PublishedEntries.d.ts +69 -0
- package/dist/domain/service/io/PublishedEntries.d.ts.map +1 -0
- package/dist/domain/service/io/PublishedEntries.js +116 -0
- package/dist/domain/service/io/PublishedEntries.js.map +1 -0
- package/dist/domain/service/io/index.d.ts +9 -0
- package/dist/domain/service/io/index.d.ts.map +1 -0
- package/dist/domain/service/io/index.js +9 -0
- package/dist/domain/service/io/index.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/boot/canonicalMigrations.d.ts +9 -0
- package/dist/infrastructure/boot/canonicalMigrations.d.ts.map +1 -0
- package/dist/infrastructure/boot/canonicalMigrations.js +162 -0
- package/dist/infrastructure/boot/canonicalMigrations.js.map +1 -0
- package/dist/infrastructure/boot/index.d.ts +2 -0
- package/dist/infrastructure/boot/index.d.ts.map +1 -0
- package/dist/infrastructure/boot/index.js +2 -0
- package/dist/infrastructure/boot/index.js.map +1 -0
- package/dist/infrastructure/http/DiagnosticResponse.d.ts +12 -0
- package/dist/infrastructure/http/DiagnosticResponse.d.ts.map +1 -0
- package/dist/infrastructure/http/DiagnosticResponse.js +14 -0
- package/dist/infrastructure/http/DiagnosticResponse.js.map +1 -0
- package/dist/infrastructure/http/index.d.ts +2 -0
- package/dist/infrastructure/http/index.d.ts.map +1 -0
- package/dist/infrastructure/http/index.js +2 -0
- package/dist/infrastructure/http/index.js.map +1 -0
- package/dist/infrastructure/index.d.ts +12 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +12 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/infrastructure/mcp/McpJsonRpcDispatcher.d.ts +60 -0
- package/dist/infrastructure/mcp/McpJsonRpcDispatcher.d.ts.map +1 -0
- package/dist/infrastructure/mcp/McpJsonRpcDispatcher.js +281 -0
- package/dist/infrastructure/mcp/McpJsonRpcDispatcher.js.map +1 -0
- package/dist/infrastructure/mcp/McpResponses.d.ts +14 -0
- package/dist/infrastructure/mcp/McpResponses.d.ts.map +1 -0
- package/dist/infrastructure/mcp/McpResponses.js +49 -0
- package/dist/infrastructure/mcp/McpResponses.js.map +1 -0
- package/dist/infrastructure/mcp/McpToolCatalog.d.ts +68 -0
- package/dist/infrastructure/mcp/McpToolCatalog.d.ts.map +1 -0
- package/dist/infrastructure/mcp/McpToolCatalog.js +231 -0
- package/dist/infrastructure/mcp/McpToolCatalog.js.map +1 -0
- package/dist/infrastructure/mcp/index.d.ts +4 -0
- package/dist/infrastructure/mcp/index.d.ts.map +1 -0
- package/dist/infrastructure/mcp/index.js +4 -0
- package/dist/infrastructure/mcp/index.js.map +1 -0
- package/dist/infrastructure/persistence/DatabaseEntryRepository.d.ts +35 -0
- package/dist/infrastructure/persistence/DatabaseEntryRepository.d.ts.map +1 -0
- package/dist/infrastructure/persistence/DatabaseEntryRepository.js +228 -0
- package/dist/infrastructure/persistence/DatabaseEntryRepository.js.map +1 -0
- package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.d.ts +12 -0
- package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.d.ts.map +1 -0
- package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.js +101 -0
- package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.js.map +1 -0
- package/dist/infrastructure/persistence/LifecycleHookingEntryRepository.d.ts +74 -0
- package/dist/infrastructure/persistence/LifecycleHookingEntryRepository.d.ts.map +1 -0
- package/dist/infrastructure/persistence/LifecycleHookingEntryRepository.js +208 -0
- package/dist/infrastructure/persistence/LifecycleHookingEntryRepository.js.map +1 -0
- package/dist/infrastructure/persistence/index.d.ts +4 -0
- package/dist/infrastructure/persistence/index.d.ts.map +1 -0
- package/dist/infrastructure/persistence/index.js +4 -0
- package/dist/infrastructure/persistence/index.js.map +1 -0
- package/dist/infrastructure/render/HtmlPublishOrchestrator.d.ts +34 -0
- package/dist/infrastructure/render/HtmlPublishOrchestrator.d.ts.map +1 -0
- package/dist/infrastructure/render/HtmlPublishOrchestrator.js +116 -0
- package/dist/infrastructure/render/HtmlPublishOrchestrator.js.map +1 -0
- package/dist/infrastructure/render/index.d.ts +2 -0
- package/dist/infrastructure/render/index.d.ts.map +1 -0
- package/dist/infrastructure/render/index.js +2 -0
- package/dist/infrastructure/render/index.js.map +1 -0
- package/dist/runtime.d.ts +132 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +142 -0
- package/dist/runtime.js.map +1 -0
- package/dist/usecase/boot/ValidateBootUseCase.d.ts +57 -0
- package/dist/usecase/boot/ValidateBootUseCase.d.ts.map +1 -0
- package/dist/usecase/boot/ValidateBootUseCase.js +181 -0
- package/dist/usecase/boot/ValidateBootUseCase.js.map +1 -0
- package/dist/usecase/boot/index.d.ts +2 -0
- package/dist/usecase/boot/index.d.ts.map +1 -0
- package/dist/usecase/boot/index.js +2 -0
- package/dist/usecase/boot/index.js.map +1 -0
- package/dist/usecase/content/ArchiveUseCase.d.ts +20 -0
- package/dist/usecase/content/ArchiveUseCase.d.ts.map +1 -0
- package/dist/usecase/content/ArchiveUseCase.js +47 -0
- package/dist/usecase/content/ArchiveUseCase.js.map +1 -0
- package/dist/usecase/content/ContentPublishEffects.d.ts +11 -0
- package/dist/usecase/content/ContentPublishEffects.d.ts.map +1 -0
- package/dist/usecase/content/ContentPublishEffects.js +21 -0
- package/dist/usecase/content/ContentPublishEffects.js.map +1 -0
- package/dist/usecase/content/CreateDraftUseCase.d.ts +22 -0
- package/dist/usecase/content/CreateDraftUseCase.d.ts.map +1 -0
- package/dist/usecase/content/CreateDraftUseCase.js +61 -0
- package/dist/usecase/content/CreateDraftUseCase.js.map +1 -0
- package/dist/usecase/content/DeleteEntryUseCase.d.ts +20 -0
- package/dist/usecase/content/DeleteEntryUseCase.d.ts.map +1 -0
- package/dist/usecase/content/DeleteEntryUseCase.js +34 -0
- package/dist/usecase/content/DeleteEntryUseCase.js.map +1 -0
- package/dist/usecase/content/GetEntryUseCase.d.ts +13 -0
- package/dist/usecase/content/GetEntryUseCase.d.ts.map +1 -0
- package/dist/usecase/content/GetEntryUseCase.js +24 -0
- package/dist/usecase/content/GetEntryUseCase.js.map +1 -0
- package/dist/usecase/content/ListEntriesUseCase.d.ts +39 -0
- package/dist/usecase/content/ListEntriesUseCase.d.ts.map +1 -0
- package/dist/usecase/content/ListEntriesUseCase.js +58 -0
- package/dist/usecase/content/ListEntriesUseCase.js.map +1 -0
- package/dist/usecase/content/RequestPublishUseCase.d.ts +30 -0
- package/dist/usecase/content/RequestPublishUseCase.d.ts.map +1 -0
- package/dist/usecase/content/RequestPublishUseCase.js +111 -0
- package/dist/usecase/content/RequestPublishUseCase.js.map +1 -0
- package/dist/usecase/content/UnpublishUseCase.d.ts +19 -0
- package/dist/usecase/content/UnpublishUseCase.d.ts.map +1 -0
- package/dist/usecase/content/UnpublishUseCase.js +46 -0
- package/dist/usecase/content/UnpublishUseCase.js.map +1 -0
- package/dist/usecase/content/UpdateDraftUseCase.d.ts +20 -0
- package/dist/usecase/content/UpdateDraftUseCase.d.ts.map +1 -0
- package/dist/usecase/content/UpdateDraftUseCase.js +86 -0
- package/dist/usecase/content/UpdateDraftUseCase.js.map +1 -0
- package/dist/usecase/content/diagnostics.d.ts +26 -0
- package/dist/usecase/content/diagnostics.d.ts.map +1 -0
- package/dist/usecase/content/diagnostics.js +100 -0
- package/dist/usecase/content/diagnostics.js.map +1 -0
- package/dist/usecase/content/index.d.ts +15 -0
- package/dist/usecase/content/index.d.ts.map +1 -0
- package/dist/usecase/content/index.js +15 -0
- package/dist/usecase/content/index.js.map +1 -0
- package/dist/usecase/dto/content/index.d.ts +73 -0
- package/dist/usecase/dto/content/index.d.ts.map +1 -0
- package/dist/usecase/dto/content/index.js +2 -0
- package/dist/usecase/dto/content/index.js.map +1 -0
- package/dist/usecase/dto/index.d.ts +13 -0
- package/dist/usecase/dto/index.d.ts.map +1 -0
- package/dist/usecase/dto/index.js +13 -0
- package/dist/usecase/dto/index.js.map +1 -0
- package/dist/usecase/dto/lifecycle/index.d.ts +15 -0
- package/dist/usecase/dto/lifecycle/index.d.ts.map +1 -0
- package/dist/usecase/dto/lifecycle/index.js +2 -0
- package/dist/usecase/dto/lifecycle/index.js.map +1 -0
- package/dist/usecase/dto/media/index.d.ts +32 -0
- package/dist/usecase/dto/media/index.d.ts.map +1 -0
- package/dist/usecase/dto/media/index.js +8 -0
- package/dist/usecase/dto/media/index.js.map +1 -0
- package/dist/usecase/dto/procedure/index.d.ts +37 -0
- package/dist/usecase/dto/procedure/index.d.ts.map +1 -0
- package/dist/usecase/dto/procedure/index.js +2 -0
- package/dist/usecase/dto/procedure/index.js.map +1 -0
- package/dist/usecase/dto/render/ComposeEntrySeoMetaRequest.d.ts +14 -0
- package/dist/usecase/dto/render/ComposeEntrySeoMetaRequest.d.ts.map +1 -0
- package/dist/usecase/dto/render/ComposeEntrySeoMetaRequest.js +2 -0
- package/dist/usecase/dto/render/ComposeEntrySeoMetaRequest.js.map +1 -0
- package/dist/usecase/dto/render/ComposeLlmsTxtRequest.d.ts +8 -0
- package/dist/usecase/dto/render/ComposeLlmsTxtRequest.d.ts.map +1 -0
- package/dist/usecase/dto/render/ComposeLlmsTxtRequest.js +2 -0
- package/dist/usecase/dto/render/ComposeLlmsTxtRequest.js.map +1 -0
- package/dist/usecase/dto/render/ComposeSitemapRequest.d.ts +11 -0
- package/dist/usecase/dto/render/ComposeSitemapRequest.d.ts.map +1 -0
- package/dist/usecase/dto/render/ComposeSitemapRequest.js +2 -0
- package/dist/usecase/dto/render/ComposeSitemapRequest.js.map +1 -0
- package/dist/usecase/dto/render/PreviewEntryRequest.d.ts +27 -0
- package/dist/usecase/dto/render/PreviewEntryRequest.d.ts.map +1 -0
- package/dist/usecase/dto/render/PreviewEntryRequest.js +2 -0
- package/dist/usecase/dto/render/PreviewEntryRequest.js.map +1 -0
- package/dist/usecase/dto/render/RenderEntryLiveRequest.d.ts +17 -0
- package/dist/usecase/dto/render/RenderEntryLiveRequest.d.ts.map +1 -0
- package/dist/usecase/dto/render/RenderEntryLiveRequest.js +2 -0
- package/dist/usecase/dto/render/RenderEntryLiveRequest.js.map +1 -0
- package/dist/usecase/dto/render/RenderListLiveRequest.d.ts +11 -0
- package/dist/usecase/dto/render/RenderListLiveRequest.d.ts.map +1 -0
- package/dist/usecase/dto/render/RenderListLiveRequest.js +2 -0
- package/dist/usecase/dto/render/RenderListLiveRequest.js.map +1 -0
- package/dist/usecase/dto/render/index.d.ts +7 -0
- package/dist/usecase/dto/render/index.d.ts.map +1 -0
- package/dist/usecase/dto/render/index.js +7 -0
- package/dist/usecase/dto/render/index.js.map +1 -0
- package/dist/usecase/dto/view/ExecuteViewRequest.d.ts +16 -0
- package/dist/usecase/dto/view/ExecuteViewRequest.d.ts.map +1 -0
- package/dist/usecase/dto/view/ExecuteViewRequest.js +2 -0
- package/dist/usecase/dto/view/ExecuteViewRequest.js.map +1 -0
- package/dist/usecase/dto/view/index.d.ts +2 -0
- package/dist/usecase/dto/view/index.d.ts.map +1 -0
- package/dist/usecase/dto/view/index.js +2 -0
- package/dist/usecase/dto/view/index.js.map +1 -0
- package/dist/usecase/index.d.ts +16 -0
- package/dist/usecase/index.d.ts.map +1 -0
- package/dist/usecase/index.js +16 -0
- package/dist/usecase/index.js.map +1 -0
- package/dist/usecase/lifecycle/RunDeferredHookUseCase.d.ts +26 -0
- package/dist/usecase/lifecycle/RunDeferredHookUseCase.d.ts.map +1 -0
- package/dist/usecase/lifecycle/RunDeferredHookUseCase.js +44 -0
- package/dist/usecase/lifecycle/RunDeferredHookUseCase.js.map +1 -0
- package/dist/usecase/lifecycle/RunLifecycleHooksUseCase.d.ts +38 -0
- package/dist/usecase/lifecycle/RunLifecycleHooksUseCase.d.ts.map +1 -0
- package/dist/usecase/lifecycle/RunLifecycleHooksUseCase.js +67 -0
- package/dist/usecase/lifecycle/RunLifecycleHooksUseCase.js.map +1 -0
- package/dist/usecase/lifecycle/index.d.ts +3 -0
- package/dist/usecase/lifecycle/index.d.ts.map +1 -0
- package/dist/usecase/lifecycle/index.js +3 -0
- package/dist/usecase/lifecycle/index.js.map +1 -0
- package/dist/usecase/media/CommitMediaUploadUseCase.d.ts +15 -0
- package/dist/usecase/media/CommitMediaUploadUseCase.d.ts.map +1 -0
- package/dist/usecase/media/CommitMediaUploadUseCase.js +43 -0
- package/dist/usecase/media/CommitMediaUploadUseCase.js.map +1 -0
- package/dist/usecase/media/CreateMediaUploadUseCase.d.ts +18 -0
- package/dist/usecase/media/CreateMediaUploadUseCase.d.ts.map +1 -0
- package/dist/usecase/media/CreateMediaUploadUseCase.js +71 -0
- package/dist/usecase/media/CreateMediaUploadUseCase.js.map +1 -0
- package/dist/usecase/media/PendingUploadRecord.d.ts +17 -0
- package/dist/usecase/media/PendingUploadRecord.d.ts.map +1 -0
- package/dist/usecase/media/PendingUploadRecord.js +2 -0
- package/dist/usecase/media/PendingUploadRecord.js.map +1 -0
- package/dist/usecase/media/diagnostics.d.ts +15 -0
- package/dist/usecase/media/diagnostics.d.ts.map +1 -0
- package/dist/usecase/media/diagnostics.js +88 -0
- package/dist/usecase/media/diagnostics.js.map +1 -0
- package/dist/usecase/media/index.d.ts +4 -0
- package/dist/usecase/media/index.d.ts.map +1 -0
- package/dist/usecase/media/index.js +4 -0
- package/dist/usecase/media/index.js.map +1 -0
- package/dist/usecase/media/mediaAllowlist.d.ts +30 -0
- package/dist/usecase/media/mediaAllowlist.d.ts.map +1 -0
- package/dist/usecase/media/mediaAllowlist.js +53 -0
- package/dist/usecase/media/mediaAllowlist.js.map +1 -0
- package/dist/usecase/procedure/InvokeBuiltinUseCase.d.ts +43 -0
- package/dist/usecase/procedure/InvokeBuiltinUseCase.d.ts.map +1 -0
- package/dist/usecase/procedure/InvokeBuiltinUseCase.js +202 -0
- package/dist/usecase/procedure/InvokeBuiltinUseCase.js.map +1 -0
- package/dist/usecase/procedure/InvokeProcedureUseCase.d.ts +50 -0
- package/dist/usecase/procedure/InvokeProcedureUseCase.d.ts.map +1 -0
- package/dist/usecase/procedure/InvokeProcedureUseCase.js +191 -0
- package/dist/usecase/procedure/InvokeProcedureUseCase.js.map +1 -0
- package/dist/usecase/procedure/index.d.ts +3 -0
- package/dist/usecase/procedure/index.d.ts.map +1 -0
- package/dist/usecase/procedure/index.js +3 -0
- package/dist/usecase/procedure/index.js.map +1 -0
- package/dist/usecase/render/ComposeEntrySeoMetaUseCase.d.ts +25 -0
- package/dist/usecase/render/ComposeEntrySeoMetaUseCase.d.ts.map +1 -0
- package/dist/usecase/render/ComposeEntrySeoMetaUseCase.js +55 -0
- package/dist/usecase/render/ComposeEntrySeoMetaUseCase.js.map +1 -0
- package/dist/usecase/render/ComposeLlmsTxtUseCase.d.ts +19 -0
- package/dist/usecase/render/ComposeLlmsTxtUseCase.d.ts.map +1 -0
- package/dist/usecase/render/ComposeLlmsTxtUseCase.js +40 -0
- package/dist/usecase/render/ComposeLlmsTxtUseCase.js.map +1 -0
- package/dist/usecase/render/ComposeSitemapUseCase.d.ts +15 -0
- package/dist/usecase/render/ComposeSitemapUseCase.d.ts.map +1 -0
- package/dist/usecase/render/ComposeSitemapUseCase.js +29 -0
- package/dist/usecase/render/ComposeSitemapUseCase.js.map +1 -0
- package/dist/usecase/render/PreviewEntryUseCase.d.ts +26 -0
- package/dist/usecase/render/PreviewEntryUseCase.d.ts.map +1 -0
- package/dist/usecase/render/PreviewEntryUseCase.js +69 -0
- package/dist/usecase/render/PreviewEntryUseCase.js.map +1 -0
- package/dist/usecase/render/RenderEntryLiveUseCase.d.ts +35 -0
- package/dist/usecase/render/RenderEntryLiveUseCase.d.ts.map +1 -0
- package/dist/usecase/render/RenderEntryLiveUseCase.js +59 -0
- package/dist/usecase/render/RenderEntryLiveUseCase.js.map +1 -0
- package/dist/usecase/render/RenderListLiveUseCase.d.ts +23 -0
- package/dist/usecase/render/RenderListLiveUseCase.d.ts.map +1 -0
- package/dist/usecase/render/RenderListLiveUseCase.js +41 -0
- package/dist/usecase/render/RenderListLiveUseCase.js.map +1 -0
- package/dist/usecase/render/index.d.ts +7 -0
- package/dist/usecase/render/index.d.ts.map +1 -0
- package/dist/usecase/render/index.js +10 -0
- package/dist/usecase/render/index.js.map +1 -0
- package/dist/usecase/view/ExecuteViewUseCase.d.ts +31 -0
- package/dist/usecase/view/ExecuteViewUseCase.d.ts.map +1 -0
- package/dist/usecase/view/ExecuteViewUseCase.js +78 -0
- package/dist/usecase/view/ExecuteViewUseCase.js.map +1 -0
- package/dist/usecase/view/index.d.ts +2 -0
- package/dist/usecase/view/index.d.ts.map +1 -0
- package/dist/usecase/view/index.js +2 -0
- package/dist/usecase/view/index.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { CLAM_BIND_KEYWORD, } from "@aotter/mantle-spec";
|
|
2
|
+
import { mcpToolNameSegment } from "../../domain/service/McpToolNaming.js";
|
|
3
|
+
export const MEDIA_TOOLS = [
|
|
4
|
+
buildCreateMediaUploadTool(),
|
|
5
|
+
{
|
|
6
|
+
name: "commit_media_upload",
|
|
7
|
+
description: "Commit a previously-PUT object. Verifies the bytes landed at the storage backend and writes commit metadata. Returns the committed MediaAsset including its publicUrl. Only registered when the runtime has a media storage adapter bound and a media.purposes taxonomy declared.",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
uploadId: { type: "string", description: "Returned by create_media_upload." },
|
|
12
|
+
alt: { type: "string" },
|
|
13
|
+
caption: { type: "string" },
|
|
14
|
+
checksum: { type: "string", description: "Optional client-side sha256; verified against storage etag when supplied." },
|
|
15
|
+
},
|
|
16
|
+
required: ["uploadId"],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
function buildMediaTools(mediaPurposes) {
|
|
21
|
+
return [
|
|
22
|
+
buildCreateMediaUploadTool(mediaPurposes),
|
|
23
|
+
MEDIA_TOOLS[1],
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
function buildCreateMediaUploadTool(mediaPurposes = []) {
|
|
27
|
+
const purpose = {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Required purpose tag declared by this starter.",
|
|
30
|
+
};
|
|
31
|
+
if (mediaPurposes.length > 0)
|
|
32
|
+
purpose["enum"] = [...mediaPurposes];
|
|
33
|
+
return {
|
|
34
|
+
name: "create_media_upload",
|
|
35
|
+
description: "Issue a short-lived direct-upload capability for a media object. The caller PUTs the bytes to the returned uploadUrl using the requiredHeaders, then calls commit_media_upload with the same uploadId. Only registered when the runtime has a media storage adapter bound and a media.purposes taxonomy declared.",
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: "object",
|
|
38
|
+
properties: {
|
|
39
|
+
filename: { type: "string", description: "Original filename — used in object metadata only; the storage key is server-generated." },
|
|
40
|
+
mimeType: { type: "string", description: "Content-Type. Allowlist: image/png, image/jpeg, image/webp, image/gif. SVG only with adapter opt-in." },
|
|
41
|
+
byteSize: { type: "number", description: "Required. Caller-supplied byte size — enforced against the per-runtime byte ceiling before a presigned URL is minted." },
|
|
42
|
+
alt: { type: "string" },
|
|
43
|
+
caption: { type: "string" },
|
|
44
|
+
purpose,
|
|
45
|
+
},
|
|
46
|
+
required: ["filename", "mimeType", "byteSize", "purpose"],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export const GENERIC_TOOLS = [
|
|
51
|
+
{
|
|
52
|
+
name: "list_entries",
|
|
53
|
+
description: "List entries in a collection. Optional filter by status. Result is { rows, nextCursor? }: when `nextCursor` is present, pass it back as `cursor` to fetch the next page. Absent `nextCursor` means this is the last page.",
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
collection: { type: "string" },
|
|
58
|
+
status: { type: "string", enum: ["draft", "published", "archived"] },
|
|
59
|
+
limit: { type: "number" },
|
|
60
|
+
cursor: { type: "string", description: "Opaque continuation token from a previous list_entries response." },
|
|
61
|
+
},
|
|
62
|
+
required: ["collection"],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "get_entry",
|
|
67
|
+
description: "Fetch a single entry by id.",
|
|
68
|
+
inputSchema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: { id: { type: "string" } },
|
|
71
|
+
required: ["id"],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "request_publish",
|
|
76
|
+
description: "Publish a draft. v0.1.0 simple lifecycle: publishes immediately.",
|
|
77
|
+
inputSchema: {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: { id: { type: "string" } },
|
|
80
|
+
required: ["id"],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "unpublish_entry",
|
|
85
|
+
description: "Unpublish a published or archived entry back to draft before editing.",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: { id: { type: "string" } },
|
|
89
|
+
required: ["id"],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "archive_entry",
|
|
94
|
+
description: "Archive an entry. Requires expected_version (OCC).",
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: "object",
|
|
97
|
+
properties: {
|
|
98
|
+
id: { type: "string" },
|
|
99
|
+
expected_version: { type: "number" },
|
|
100
|
+
},
|
|
101
|
+
required: ["id", "expected_version"],
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "delete_entry",
|
|
106
|
+
description: "Permanently delete an entry. Cascades to its revisions and approvals. Prefer archive_entry when reversibility matters.",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: { id: { type: "string" } },
|
|
110
|
+
required: ["id"],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
export const CREATE_DRAFT_PREFIX = "create_draft_";
|
|
115
|
+
export const UPDATE_DRAFT_PREFIX = "update_draft_";
|
|
116
|
+
export const QUERY_VIEW_PREFIX = "query_view_";
|
|
117
|
+
export function buildMcpToolCatalog(schemas, opts = {}) {
|
|
118
|
+
const surface = opts.surface ?? "staff";
|
|
119
|
+
if (surface === "public") {
|
|
120
|
+
return (opts.views ?? []).map(buildQueryViewTool);
|
|
121
|
+
}
|
|
122
|
+
const out = [...GENERIC_TOOLS];
|
|
123
|
+
if (opts.mediaEnabled)
|
|
124
|
+
out.push(...buildMediaTools(opts.mediaPurposes ?? []));
|
|
125
|
+
for (const s of schemas) {
|
|
126
|
+
out.push(buildCreateTool(s));
|
|
127
|
+
out.push(buildUpdateTool(s));
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
/** Re-export the naming util from `domain/service/` so existing
|
|
132
|
+
* consumers of `McpToolCatalog` (the dispatcher) keep their import
|
|
133
|
+
* surface stable. */
|
|
134
|
+
export { mcpToolNameSegment as toolNameSegment };
|
|
135
|
+
/** Inverse routing: given a tool name and its prefix, recover the
|
|
136
|
+
* segment. Returns `null` if the name doesn't carry the prefix. */
|
|
137
|
+
export function extractCollectionSegment(toolName, prefix) {
|
|
138
|
+
if (!toolName.startsWith(prefix))
|
|
139
|
+
return null;
|
|
140
|
+
const segment = toolName.slice(prefix.length);
|
|
141
|
+
return segment.length === 0 ? null : segment;
|
|
142
|
+
}
|
|
143
|
+
function buildCreateTool(schema) {
|
|
144
|
+
const { properties, required } = filterAuthoringFields(schema);
|
|
145
|
+
const inputSchema = {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties,
|
|
148
|
+
};
|
|
149
|
+
if (required.length > 0)
|
|
150
|
+
inputSchema["required"] = required;
|
|
151
|
+
return {
|
|
152
|
+
name: `${CREATE_DRAFT_PREFIX}${mcpToolNameSegment(schema.metadata.name)}`,
|
|
153
|
+
description: describeCreateTool(schema),
|
|
154
|
+
inputSchema,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function buildUpdateTool(schema) {
|
|
158
|
+
const { properties, required } = filterAuthoringFields(schema);
|
|
159
|
+
const inputSchema = {
|
|
160
|
+
type: "object",
|
|
161
|
+
properties: {
|
|
162
|
+
id: { type: "string", description: "Entry id to update." },
|
|
163
|
+
expected_version: {
|
|
164
|
+
type: "number",
|
|
165
|
+
description: "OCC version (must match current row version).",
|
|
166
|
+
},
|
|
167
|
+
...properties,
|
|
168
|
+
},
|
|
169
|
+
required: ["id", "expected_version", ...required],
|
|
170
|
+
};
|
|
171
|
+
return {
|
|
172
|
+
name: `${UPDATE_DRAFT_PREFIX}${mcpToolNameSegment(schema.metadata.name)}`,
|
|
173
|
+
description: describeUpdateTool(schema),
|
|
174
|
+
inputSchema,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function buildQueryViewTool(view) {
|
|
178
|
+
const params = view.spec.params;
|
|
179
|
+
const properties = {
|
|
180
|
+
...(params?.properties ?? {}),
|
|
181
|
+
page: { type: "number", description: "Optional 1-based page number." },
|
|
182
|
+
show: { type: "number", description: "Optional page size, capped by the View limit." },
|
|
183
|
+
};
|
|
184
|
+
const inputSchema = {
|
|
185
|
+
type: "object",
|
|
186
|
+
properties,
|
|
187
|
+
};
|
|
188
|
+
if (params?.required?.length)
|
|
189
|
+
inputSchema["required"] = params.required;
|
|
190
|
+
return {
|
|
191
|
+
name: `${QUERY_VIEW_PREFIX}${mcpToolNameSegment(view.metadata.name)}`,
|
|
192
|
+
description: `Query public View '${view.metadata.name}'.`,
|
|
193
|
+
inputSchema,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function describeCreateTool(schema) {
|
|
197
|
+
const base = `Create a new draft entry in '${schema.metadata.name}'.`;
|
|
198
|
+
return schema.spec.description ? `${base} ${schema.spec.description}`.trim() : base;
|
|
199
|
+
}
|
|
200
|
+
function describeUpdateTool(schema) {
|
|
201
|
+
return `Update a draft entry in '${schema.metadata.name}' with optimistic-concurrency check.`;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Strip server-stamped properties (those carrying `x-clam-bind`) from
|
|
205
|
+
* the Schema's authoring surface. The agent must not send these — the
|
|
206
|
+
* builtin op projection drops them anyway, but exposing them in the
|
|
207
|
+
* tool schema would invite confusion.
|
|
208
|
+
*
|
|
209
|
+
* The remaining `required` is the intersection of the original
|
|
210
|
+
* `required` array and the surviving property keys.
|
|
211
|
+
*/
|
|
212
|
+
function filterAuthoringFields(schema) {
|
|
213
|
+
const props = schema.spec.schema.properties ?? {};
|
|
214
|
+
const originalRequired = schema.spec.schema.required ?? [];
|
|
215
|
+
const properties = {};
|
|
216
|
+
const required = [];
|
|
217
|
+
for (const [key, propDef] of Object.entries(props)) {
|
|
218
|
+
if (hasClamBind(propDef))
|
|
219
|
+
continue;
|
|
220
|
+
properties[key] = propDef;
|
|
221
|
+
if (originalRequired.includes(key))
|
|
222
|
+
required.push(key);
|
|
223
|
+
}
|
|
224
|
+
return { properties, required };
|
|
225
|
+
}
|
|
226
|
+
function hasClamBind(propDef) {
|
|
227
|
+
if (typeof propDef !== "object" || propDef === null)
|
|
228
|
+
return false;
|
|
229
|
+
return CLAM_BIND_KEYWORD in propDef;
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=McpToolCatalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McpToolCatalog.js","sourceRoot":"","sources":["../../../src/infrastructure/mcp/McpToolCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAmC3E,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,0BAA0B,EAAE;IAC5B;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,mRAAmR;QACrR,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;gBAC7E,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACvB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2EAA2E,EAAE;aACvH;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB;KACF;CACF,CAAC;AAEF,SAAS,eAAe,CAAC,aAAgC;IACvD,OAAO;QACL,0BAA0B,CAAC,aAAa,CAAC;QACzC,WAAW,CAAC,CAAC,CAAE;KAChB,CAAC;AACJ,CAAC;AAED,SAA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AA4B,EAAE,CAAC;IAC/C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACnD,IAAI,WAAW,CAAC,OAAO,CAAC;YAAE,SAAS;QACnC,UAAU,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QAC1B,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,WAAW,CAAC,OAAgB;IACnC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAClE,OAAO,iBAAiB,IAAK,OAAmC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { GENERIC_TOOLS, CREATE_DRAFT_PREFIX, UPDATE_DRAFT_PREFIX, buildMcpToolCatalog, toolNameSegment, extractCollectionSegment, type McpToolDefinition, } from "./McpToolCatalog.js";
|
|
2
|
+
export { jsonRpcOk, jsonRpcOkRaw, jsonRpcError, mcpJsonRpcError, mcpUnauthenticated, } from "./McpResponses.js";
|
|
3
|
+
export { McpJsonRpcDispatcher, type McpAuthContext, type McpUseCases, } from "./McpJsonRpcDispatcher.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { GENERIC_TOOLS, CREATE_DRAFT_PREFIX, UPDATE_DRAFT_PREFIX, buildMcpToolCatalog, toolNameSegment, extractCollectionSegment, } from "./McpToolCatalog.js";
|
|
2
|
+
export { jsonRpcOk, jsonRpcOkRaw, jsonRpcError, mcpJsonRpcError, mcpUnauthenticated, } from "./McpResponses.js";
|
|
3
|
+
export { McpJsonRpcDispatcher, } from "./McpJsonRpcDispatcher.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,GAEzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,GAGrB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ArchiveEntryArgs, CreateEntryArgs, DeleteEntryArgs, EntryRepository, FindEntryByDataFieldArgs, FindEntryByDataFieldsArgs, ListEntriesArgs, ListEntriesResult, TransitionStatusArgs, UpdateEntryArgs } from "../../domain/port/EntryRepository.js";
|
|
2
|
+
import type { DatabaseDriver } from "../../domain/port/DatabaseDriver.js";
|
|
3
|
+
import { type EntryRow } from "../../domain/model/EntryRow.js";
|
|
4
|
+
/**
|
|
5
|
+
* `EntryRepository` impl backed by `DatabaseDriver`. Adapters that
|
|
6
|
+
* implement `DatabaseDriver` (CF binds D1; future Postgres, Neon,
|
|
7
|
+
* etc.) get this repository for free; the SQL is SQLite-shaped
|
|
8
|
+
* (which Postgres can also execute via Hyperdrive when v0.2 lands).
|
|
9
|
+
*
|
|
10
|
+
* `UPDATE … RETURNING` collapses the post-write SELECT to one round
|
|
11
|
+
* trip on SQLite ≥ 3.35 / Postgres. `delete` uses
|
|
12
|
+
* `DatabaseDriver.batch` because SQLite doesn't enforce FK ON DELETE
|
|
13
|
+
* CASCADE by default and we'd otherwise orphan revisions / approvals
|
|
14
|
+
* when the parent goes.
|
|
15
|
+
*
|
|
16
|
+
* Lifts `data.locale` to `EntryRow.locale` at the rowFromDb boundary
|
|
17
|
+
* — see ADR-0010 + `domain/model/EntryRow.ts`.
|
|
18
|
+
*/
|
|
19
|
+
export declare class DatabaseEntryRepository implements EntryRepository {
|
|
20
|
+
private readonly db;
|
|
21
|
+
constructor(db: DatabaseDriver);
|
|
22
|
+
create(args: CreateEntryArgs): Promise<EntryRow>;
|
|
23
|
+
get(id: string): Promise<EntryRow | null>;
|
|
24
|
+
update(args: UpdateEntryArgs): Promise<EntryRow>;
|
|
25
|
+
delete(args: DeleteEntryArgs): Promise<{
|
|
26
|
+
readonly removed: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
archive(args: ArchiveEntryArgs): Promise<EntryRow>;
|
|
29
|
+
transitionStatus(args: TransitionStatusArgs): Promise<EntryRow>;
|
|
30
|
+
list(args: ListEntriesArgs): Promise<ListEntriesResult>;
|
|
31
|
+
findByDataField(args: FindEntryByDataFieldArgs): Promise<EntryRow | null>;
|
|
32
|
+
findByDataFields(args: FindEntryByDataFieldsArgs): Promise<EntryRow | null>;
|
|
33
|
+
private versionConflict;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=DatabaseEntryRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabaseEntryRepository.d.ts","sour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@@
|
|
|
1
|
+
import { clampLimit } from "../../domain/service/Pagination.js";
|
|
2
|
+
import { EntryStatusConflict, EntryVersionConflict, liftLocale, } from "../../domain/model/EntryRow.js";
|
|
3
|
+
/**
|
|
4
|
+
* `EntryRepository` impl backed by `DatabaseDriver`. Adapters that
|
|
5
|
+
* implement `DatabaseDriver` (CF binds D1; future Postgres, Neon,
|
|
6
|
+
* etc.) get this repository for free; the SQL is SQLite-shaped
|
|
7
|
+
* (which Postgres can also execute via Hyperdrive when v0.2 lands).
|
|
8
|
+
*
|
|
9
|
+
* `UPDATE … RETURNING` collapses the post-write SELECT to one round
|
|
10
|
+
* trip on SQLite ≥ 3.35 / Postgres. `delete` uses
|
|
11
|
+
* `DatabaseDriver.batch` because SQLite doesn't enforce FK ON DELETE
|
|
12
|
+
* CASCADE by default and we'd otherwise orphan revisions / approvals
|
|
13
|
+
* when the parent goes.
|
|
14
|
+
*
|
|
15
|
+
* Lifts `data.locale` to `EntryRow.locale` at the rowFromDb boundary
|
|
16
|
+
* — see ADR-0010 + `domain/model/EntryRow.ts`.
|
|
17
|
+
*/
|
|
18
|
+
export class DatabaseEntryRepository {
|
|
19
|
+
db;
|
|
20
|
+
constructor(db) {
|
|
21
|
+
this.db = db;
|
|
22
|
+
}
|
|
23
|
+
async create(args) {
|
|
24
|
+
await this.db
|
|
25
|
+
.prepare(`INSERT INTO entries (id, collection, status, version, data, author_id, created_at, updated_at)
|
|
26
|
+
VALUES (?, ?, ?, 1, ?, ?, ?, ?)`)
|
|
27
|
+
.bind(args.id, args.collection, args.status, JSON.stringify(args.data), args.authorId, args.now, args.now)
|
|
28
|
+
.run();
|
|
29
|
+
return {
|
|
30
|
+
id: args.id,
|
|
31
|
+
collection: args.collection,
|
|
32
|
+
locale: liftLocale(args.data),
|
|
33
|
+
status: args.status,
|
|
34
|
+
version: 1,
|
|
35
|
+
data: args.data,
|
|
36
|
+
authorId: args.authorId,
|
|
37
|
+
createdAt: args.now,
|
|
38
|
+
updatedAt: args.now,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async get(id) {
|
|
42
|
+
const row = await this.db
|
|
43
|
+
.prepare(`SELECT id, collection, status, version, data, author_id, created_at, updated_at
|
|
44
|
+
FROM entries WHERE id = ?`)
|
|
45
|
+
.bind(id)
|
|
46
|
+
.first();
|
|
47
|
+
return row ? rowFromDb(row) : null;
|
|
48
|
+
}
|
|
49
|
+
async update(args) {
|
|
50
|
+
const newVersion = args.expectedVersion + 1;
|
|
51
|
+
const row = await this.db
|
|
52
|
+
.prepare(`UPDATE entries SET data = ?, version = ?, updated_at = ?
|
|
53
|
+
WHERE id = ? AND version = ?
|
|
54
|
+
RETURNING id, collection, status, version, data, author_id, created_at, updated_at`)
|
|
55
|
+
.bind(JSON.stringify(args.data), newVersion, args.now, args.id, args.expectedVersion)
|
|
56
|
+
.first();
|
|
57
|
+
if (!row)
|
|
58
|
+
throw await this.versionConflict(args.id, args.expectedVersion);
|
|
59
|
+
return rowFromDb(row);
|
|
60
|
+
}
|
|
61
|
+
async delete(args) {
|
|
62
|
+
const result = await this.db.batch([
|
|
63
|
+
this.db.prepare(`DELETE FROM revisions WHERE entry_id = ?`).bind(args.id),
|
|
64
|
+
this.db.prepare(`DELETE FROM approvals WHERE entry_id = ?`).bind(args.id),
|
|
65
|
+
this.db.prepare(`DELETE FROM entries WHERE id = ?`).bind(args.id),
|
|
66
|
+
]);
|
|
67
|
+
const last = result[result.length - 1];
|
|
68
|
+
return { removed: (last?.meta.changes ?? 0) > 0 };
|
|
69
|
+
}
|
|
70
|
+
async archive(args) {
|
|
71
|
+
const newVersion = args.expectedVersion + 1;
|
|
72
|
+
const row = await this.db
|
|
73
|
+
.prepare(`UPDATE entries SET status = 'archived', version = ?, updated_at = ?
|
|
74
|
+
WHERE id = ? AND version = ?
|
|
75
|
+
RETURNING id, collection, status, version, data, author_id, created_at, updated_at`)
|
|
76
|
+
.bind(newVersion, args.now, args.id, args.expectedVersion)
|
|
77
|
+
.first();
|
|
78
|
+
if (!row)
|
|
79
|
+
throw await this.versionConflict(args.id, args.expectedVersion);
|
|
80
|
+
return rowFromDb(row);
|
|
81
|
+
}
|
|
82
|
+
async transitionStatus(args) {
|
|
83
|
+
const { expectedStatus, expectedVersion } = args;
|
|
84
|
+
const guards = [];
|
|
85
|
+
const binds = [args.to, args.now, args.id];
|
|
86
|
+
if (expectedStatus !== undefined) {
|
|
87
|
+
guards.push(" AND status = ?");
|
|
88
|
+
binds.push(expectedStatus);
|
|
89
|
+
}
|
|
90
|
+
if (expectedVersion !== undefined) {
|
|
91
|
+
guards.push(" AND version = ?");
|
|
92
|
+
binds.push(expectedVersion);
|
|
93
|
+
}
|
|
94
|
+
const row = await this.db
|
|
95
|
+
.prepare(`UPDATE entries SET status = ?, version = version + 1, updated_at = ?
|
|
96
|
+
WHERE id = ?${guards.join("")}
|
|
97
|
+
RETURNING id, collection, status, version, data, author_id, created_at, updated_at`)
|
|
98
|
+
.bind(...binds)
|
|
99
|
+
.first();
|
|
100
|
+
if (row)
|
|
101
|
+
return rowFromDb(row);
|
|
102
|
+
// Disambiguate version- vs. status-conflict from a single SELECT —
|
|
103
|
+
// splitting into two SELECTs leaves a TOCTOU window where a third
|
|
104
|
+
// concurrent writer between the two reads can flip which guard
|
|
105
|
+
// appears to have failed.
|
|
106
|
+
const after = await this.db
|
|
107
|
+
.prepare(`SELECT version, status FROM entries WHERE id = ?`)
|
|
108
|
+
.bind(args.id)
|
|
109
|
+
.first();
|
|
110
|
+
if (expectedVersion !== undefined && after && after.version !== expectedVersion) {
|
|
111
|
+
throw new EntryVersionConflict(args.id, expectedVersion, after.version);
|
|
112
|
+
}
|
|
113
|
+
throw new EntryStatusConflict(args.id, expectedStatus ?? args.to, after?.status ?? args.to);
|
|
114
|
+
}
|
|
115
|
+
async list(args) {
|
|
116
|
+
// Use the shared clamp so direct repo callers (tests, future
|
|
117
|
+
// adapters that bypass the use case) get the same default page
|
|
118
|
+
// size as ListEntriesUseCase — not a silently different 100.
|
|
119
|
+
const limit = clampLimit(args.limit);
|
|
120
|
+
const offset = decodeCursor(args.cursor);
|
|
121
|
+
// Fetch limit+1 to detect a next page without a second query —
|
|
122
|
+
// the extra row never reaches the caller.
|
|
123
|
+
const probe = limit + 1;
|
|
124
|
+
const stmt = args.status
|
|
125
|
+
? this.db
|
|
126
|
+
.prepare(`SELECT id, collection, status, version, data, author_id, created_at, updated_at
|
|
127
|
+
FROM entries WHERE collection = ? AND status = ?
|
|
128
|
+
ORDER BY updated_at DESC, id DESC LIMIT ? OFFSET ?`)
|
|
129
|
+
.bind(args.collection, args.status, probe, offset)
|
|
130
|
+
: this.db
|
|
131
|
+
.prepare(`SELECT id, collection, status, version, data, author_id, created_at, updated_at
|
|
132
|
+
FROM entries WHERE collection = ?
|
|
133
|
+
ORDER BY updated_at DESC, id DESC LIMIT ? OFFSET ?`)
|
|
134
|
+
.bind(args.collection, probe, offset);
|
|
135
|
+
const rows = await stmt.all();
|
|
136
|
+
const hasMore = rows.length > limit;
|
|
137
|
+
const page = hasMore ? rows.slice(0, limit) : rows;
|
|
138
|
+
return {
|
|
139
|
+
rows: page.map(rowFromDb),
|
|
140
|
+
nextCursor: hasMore ? encodeCursor(offset + limit) : undefined,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
async findByDataField(args) {
|
|
144
|
+
const path = jsonPathForTopLevelField(args.field);
|
|
145
|
+
const stmt = args.status
|
|
146
|
+
? this.db
|
|
147
|
+
.prepare(`SELECT id, collection, status, version, data, author_id, created_at, updated_at
|
|
148
|
+
FROM entries
|
|
149
|
+
WHERE collection = ? AND status = ? AND json_extract(data, ?) = ?
|
|
150
|
+
ORDER BY updated_at DESC LIMIT 1`)
|
|
151
|
+
.bind(args.collection, args.status, path, args.value)
|
|
152
|
+
: this.db
|
|
153
|
+
.prepare(`SELECT id, collection, status, version, data, author_id, created_at, updated_at
|
|
154
|
+
FROM entries
|
|
155
|
+
WHERE collection = ? AND json_extract(data, ?) = ?
|
|
156
|
+
ORDER BY updated_at DESC LIMIT 1`)
|
|
157
|
+
.bind(args.collection, path, args.value);
|
|
158
|
+
const row = await stmt.first();
|
|
159
|
+
return row ? rowFromDb(row) : null;
|
|
160
|
+
}
|
|
161
|
+
async findByDataFields(args) {
|
|
162
|
+
const entries = Object.entries(args.fields);
|
|
163
|
+
if (entries.length === 0)
|
|
164
|
+
return null;
|
|
165
|
+
const conditions = ["collection = ?"];
|
|
166
|
+
const binds = [args.collection];
|
|
167
|
+
if (args.status) {
|
|
168
|
+
conditions.push("status = ?");
|
|
169
|
+
binds.push(args.status);
|
|
170
|
+
}
|
|
171
|
+
for (const [field, value] of entries) {
|
|
172
|
+
conditions.push("json_extract(data, ?) = ?");
|
|
173
|
+
binds.push(jsonPathForTopLevelField(field), value);
|
|
174
|
+
}
|
|
175
|
+
if (args.excludeId) {
|
|
176
|
+
conditions.push("id <> ?");
|
|
177
|
+
binds.push(args.excludeId);
|
|
178
|
+
}
|
|
179
|
+
const row = await this.db
|
|
180
|
+
.prepare(`SELECT id, collection, status, version, data, author_id, created_at, updated_at
|
|
181
|
+
FROM entries
|
|
182
|
+
WHERE ${conditions.join(" AND ")}
|
|
183
|
+
ORDER BY updated_at DESC LIMIT 1`)
|
|
184
|
+
.bind(...binds)
|
|
185
|
+
.first();
|
|
186
|
+
return row ? rowFromDb(row) : null;
|
|
187
|
+
}
|
|
188
|
+
async versionConflict(id, expected) {
|
|
189
|
+
const after = await this.db
|
|
190
|
+
.prepare(`SELECT version FROM entries WHERE id = ?`)
|
|
191
|
+
.bind(id)
|
|
192
|
+
.first();
|
|
193
|
+
return new EntryVersionConflict(id, expected, after?.version ?? -1);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function rowFromDb(row) {
|
|
197
|
+
const data = JSON.parse(row.data);
|
|
198
|
+
return {
|
|
199
|
+
id: row.id,
|
|
200
|
+
collection: row.collection,
|
|
201
|
+
locale: liftLocale(data),
|
|
202
|
+
status: row.status,
|
|
203
|
+
version: row.version,
|
|
204
|
+
data,
|
|
205
|
+
authorId: row.author_id,
|
|
206
|
+
createdAt: row.created_at,
|
|
207
|
+
updatedAt: row.updated_at,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function jsonPathForTopLevelField(field) {
|
|
211
|
+
return `$."${field.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* `list()` cursor: offset-based, prefixed so a future row-value cursor
|
|
215
|
+
* (`(updatedAt,id)` tuple) can coexist by switching on the prefix.
|
|
216
|
+
* Callers treat it as opaque.
|
|
217
|
+
*/
|
|
218
|
+
const CURSOR_PREFIX = "o:";
|
|
219
|
+
function encodeCursor(offset) {
|
|
220
|
+
return `${CURSOR_PREFIX}${offset}`;
|
|
221
|
+
}
|
|
222
|
+
function decodeCursor(cursor) {
|
|
223
|
+
if (!cursor || !cursor.startsWith(CURSOR_PREFIX))
|
|
224
|
+
return 0;
|
|
225
|
+
const n = Number(cursor.slice(CURSOR_PREFIX.length));
|
|
226
|
+
return Number.isInteger(n) && n >= 0 ? n : 0;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=DatabaseEntryRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabaseEntryRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/persistence/DatabaseEntryRepository.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,GAEX,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,uBAAuB;IACL;IAA7B,YAA6B,EAAkB;QAAlB,OAAE,GAAF,EAAE,CAAgB;IAAG,CAAC;IAEnD,KAAK,CAAC,MAAM,CAAC,IAAqB;QAChC,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN;yCACiC,CAClC;aACA,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AAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAa;IAC7C,OAAO,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,SAAS,YAAY,CAAC,MAAc;IAClC,OAAO,GAAG,aAAa,GAAG,MAAM,EAAE,CAAC;AACrC,CAAC;AACD,SAAS,YAAY,CAAC,MAA0B;IAC9C,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC;QAAE,OAAO,CAAC,CAAC;IAC3D,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SiteConfig, type SiteDefaults } from "@aotter/mantle-spec";
|
|
2
|
+
import type { DatabaseDriver } from "../../domain/port/DatabaseDriver.js";
|
|
3
|
+
import type { SiteConfigRepository } from "../../domain/port/SiteConfigRepository.js";
|
|
4
|
+
export declare class DatabaseSiteConfigRepository implements SiteConfigRepository {
|
|
5
|
+
private readonly db;
|
|
6
|
+
constructor(db: DatabaseDriver);
|
|
7
|
+
seed(defaults: SiteDefaults | undefined): Promise<void>;
|
|
8
|
+
load(): Promise<SiteConfig>;
|
|
9
|
+
readLocales(): Promise<readonly string[]>;
|
|
10
|
+
readMediaPurposes(): Promise<readonly string[]>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=DatabaseSiteConfigRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabaseSiteConfigRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/persistence/DatabaseSiteConfigRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AA8BtF,qBAAa,4BAA6B,YAAW,oBAAoB;IAC3D,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,cAAc;IAEzC,IAAI,CAAC,QAAQ,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCvD,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAmB3B,WAAW,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;IAQzC,iBAAiB,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;CAOtD"}
|