@webiny/ai-powerups 0.0.0-unstable.0156a4c312
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/AiPowerups.d.ts +14 -0
- package/AiPowerups.js +11 -0
- package/AiPowerups.js.map +1 -0
- package/LICENSE +36 -0
- package/README.md +11 -0
- package/admin/Extension.d.ts +2 -0
- package/admin/Extension.js +49 -0
- package/admin/Extension.js.map +1 -0
- package/admin/domain/errors.d.ts +12 -0
- package/admin/domain/errors.js +21 -0
- package/admin/domain/errors.js.map +1 -0
- package/admin/domain/modelRoles.d.ts +17 -0
- package/admin/domain/modelRoles.js +8 -0
- package/admin/domain/modelRoles.js.map +1 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsGateway.d.ts +12 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsGateway.js +46 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsGateway.js.map +1 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsRepository.d.ts +11 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsRepository.js +18 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsRepository.js.map +1 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsUseCase.d.ts +11 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsUseCase.js +18 -0
- package/admin/features/compareEntryRevisions/CompareEntryRevisionsUseCase.js.map +1 -0
- package/admin/features/compareEntryRevisions/abstractions.d.ts +32 -0
- package/admin/features/compareEntryRevisions/abstractions.js +7 -0
- package/admin/features/compareEntryRevisions/abstractions.js.map +1 -0
- package/admin/features/compareEntryRevisions/feature.d.ts +1 -0
- package/admin/features/compareEntryRevisions/feature.js +15 -0
- package/admin/features/compareEntryRevisions/feature.js.map +1 -0
- package/admin/features/compareEntryRevisions/index.d.ts +2 -0
- package/admin/features/compareEntryRevisions/index.js +2 -0
- package/admin/features/feature.d.ts +1 -0
- package/admin/features/feature.js +26 -0
- package/admin/features/feature.js.map +1 -0
- package/admin/features/generateEntryContent/GenerateEntryContentGateway.d.ts +12 -0
- package/admin/features/generateEntryContent/GenerateEntryContentGateway.js +45 -0
- package/admin/features/generateEntryContent/GenerateEntryContentGateway.js.map +1 -0
- package/admin/features/generateEntryContent/GenerateEntryContentUseCase.d.ts +11 -0
- package/admin/features/generateEntryContent/GenerateEntryContentUseCase.js +18 -0
- package/admin/features/generateEntryContent/GenerateEntryContentUseCase.js.map +1 -0
- package/admin/features/generateEntryContent/abstractions.d.ts +24 -0
- package/admin/features/generateEntryContent/abstractions.js +6 -0
- package/admin/features/generateEntryContent/abstractions.js.map +1 -0
- package/admin/features/generateEntryContent/feature.d.ts +1 -0
- package/admin/features/generateEntryContent/feature.js +13 -0
- package/admin/features/generateEntryContent/feature.js.map +1 -0
- package/admin/features/generateEntryContent/index.d.ts +3 -0
- package/admin/features/generateEntryContent/index.js +2 -0
- package/admin/features/generatePageContent/GeneratePageContentGateway.d.ts +12 -0
- package/admin/features/generatePageContent/GeneratePageContentGateway.js +47 -0
- package/admin/features/generatePageContent/GeneratePageContentGateway.js.map +1 -0
- package/admin/features/generatePageContent/GeneratePageContentUseCase.d.ts +11 -0
- package/admin/features/generatePageContent/GeneratePageContentUseCase.js +18 -0
- package/admin/features/generatePageContent/GeneratePageContentUseCase.js.map +1 -0
- package/admin/features/generatePageContent/abstractions.d.ts +25 -0
- package/admin/features/generatePageContent/abstractions.js +6 -0
- package/admin/features/generatePageContent/abstractions.js.map +1 -0
- package/admin/features/generatePageContent/feature.d.ts +1 -0
- package/admin/features/generatePageContent/feature.js +13 -0
- package/admin/features/generatePageContent/feature.js.map +1 -0
- package/admin/features/generatePageContent/index.d.ts +3 -0
- package/admin/features/generatePageContent/index.js +2 -0
- package/admin/features/listCapabilities/ListCapabilitiesGateway.d.ts +12 -0
- package/admin/features/listCapabilities/ListCapabilitiesGateway.js +34 -0
- package/admin/features/listCapabilities/ListCapabilitiesGateway.js.map +1 -0
- package/admin/features/listCapabilities/ListCapabilitiesRepository.d.ts +13 -0
- package/admin/features/listCapabilities/ListCapabilitiesRepository.js +27 -0
- package/admin/features/listCapabilities/ListCapabilitiesRepository.js.map +1 -0
- package/admin/features/listCapabilities/ListCapabilitiesUseCase.d.ts +10 -0
- package/admin/features/listCapabilities/ListCapabilitiesUseCase.js +18 -0
- package/admin/features/listCapabilities/ListCapabilitiesUseCase.js.map +1 -0
- package/admin/features/listCapabilities/abstractions.d.ts +28 -0
- package/admin/features/listCapabilities/abstractions.js +7 -0
- package/admin/features/listCapabilities/abstractions.js.map +1 -0
- package/admin/features/listCapabilities/feature.d.ts +3 -0
- package/admin/features/listCapabilities/feature.js +21 -0
- package/admin/features/listCapabilities/feature.js.map +1 -0
- package/admin/features/listCapabilities/index.d.ts +3 -0
- package/admin/features/listCapabilities/index.js +2 -0
- package/admin/features/listModels/ListModelsGateway.d.ts +12 -0
- package/admin/features/listModels/ListModelsGateway.js +51 -0
- package/admin/features/listModels/ListModelsGateway.js.map +1 -0
- package/admin/features/listModels/ListModelsRepository.d.ts +13 -0
- package/admin/features/listModels/ListModelsRepository.js +27 -0
- package/admin/features/listModels/ListModelsRepository.js.map +1 -0
- package/admin/features/listModels/ListModelsUseCase.d.ts +10 -0
- package/admin/features/listModels/ListModelsUseCase.js +18 -0
- package/admin/features/listModels/ListModelsUseCase.js.map +1 -0
- package/admin/features/listModels/abstractions.d.ts +30 -0
- package/admin/features/listModels/abstractions.js +7 -0
- package/admin/features/listModels/abstractions.js.map +1 -0
- package/admin/features/listModels/feature.d.ts +3 -0
- package/admin/features/listModels/feature.js +21 -0
- package/admin/features/listModels/feature.js.map +1 -0
- package/admin/features/listModels/index.d.ts +2 -0
- package/admin/features/listModels/index.js +2 -0
- package/admin/features/settings/getSettings/GetSettingsGateway.d.ts +12 -0
- package/admin/features/settings/getSettings/GetSettingsGateway.js +29 -0
- package/admin/features/settings/getSettings/GetSettingsGateway.js.map +1 -0
- package/admin/features/settings/getSettings/GetSettingsRepository.d.ts +14 -0
- package/admin/features/settings/getSettings/GetSettingsRepository.js +31 -0
- package/admin/features/settings/getSettings/GetSettingsRepository.js.map +1 -0
- package/admin/features/settings/getSettings/GetSettingsUseCase.d.ts +11 -0
- package/admin/features/settings/getSettings/GetSettingsUseCase.js +18 -0
- package/admin/features/settings/getSettings/GetSettingsUseCase.js.map +1 -0
- package/admin/features/settings/getSettings/abstractions.d.ts +22 -0
- package/admin/features/settings/getSettings/abstractions.js +7 -0
- package/admin/features/settings/getSettings/abstractions.js.map +1 -0
- package/admin/features/settings/getSettings/feature.d.ts +3 -0
- package/admin/features/settings/getSettings/feature.js +21 -0
- package/admin/features/settings/getSettings/feature.js.map +1 -0
- package/admin/features/settings/getSettings/index.d.ts +2 -0
- package/admin/features/settings/getSettings/index.js +2 -0
- package/admin/features/settings/shared/SettingsCache.d.ts +10 -0
- package/admin/features/settings/shared/SettingsCache.js +19 -0
- package/admin/features/settings/shared/SettingsCache.js.map +1 -0
- package/admin/features/settings/shared/abstractions.d.ts +83 -0
- package/admin/features/settings/shared/abstractions.js +5 -0
- package/admin/features/settings/shared/abstractions.js.map +1 -0
- package/admin/features/settings/shared/feature.d.ts +3 -0
- package/admin/features/settings/shared/feature.js +17 -0
- package/admin/features/settings/shared/feature.js.map +1 -0
- package/admin/features/settings/shared/index.d.ts +2 -0
- package/admin/features/settings/shared/index.js +2 -0
- package/admin/features/settings/updateSettings/UpdateSettingsGateway.d.ts +12 -0
- package/admin/features/settings/updateSettings/UpdateSettingsGateway.js +45 -0
- package/admin/features/settings/updateSettings/UpdateSettingsGateway.js.map +1 -0
- package/admin/features/settings/updateSettings/UpdateSettingsRepository.d.ts +13 -0
- package/admin/features/settings/updateSettings/UpdateSettingsRepository.js +23 -0
- package/admin/features/settings/updateSettings/UpdateSettingsRepository.js.map +1 -0
- package/admin/features/settings/updateSettings/UpdateSettingsUseCase.d.ts +11 -0
- package/admin/features/settings/updateSettings/UpdateSettingsUseCase.js +18 -0
- package/admin/features/settings/updateSettings/UpdateSettingsUseCase.js.map +1 -0
- package/admin/features/settings/updateSettings/abstractions.d.ts +22 -0
- package/admin/features/settings/updateSettings/abstractions.js +7 -0
- package/admin/features/settings/updateSettings/abstractions.js.map +1 -0
- package/admin/features/settings/updateSettings/feature.d.ts +3 -0
- package/admin/features/settings/updateSettings/feature.js +21 -0
- package/admin/features/settings/updateSettings/feature.js.map +1 -0
- package/admin/features/settings/updateSettings/index.d.ts +2 -0
- package/admin/features/settings/updateSettings/index.js +2 -0
- package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.d.ts +4 -0
- package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js +49 -0
- package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js.map +1 -0
- package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.d.ts +26 -0
- package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.js +160 -0
- package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.js.map +1 -0
- package/admin/presentation/AiPowerUpsSettings/abstractions.d.ts +18 -0
- package/admin/presentation/AiPowerUpsSettings/abstractions.js +5 -0
- package/admin/presentation/AiPowerUpsSettings/abstractions.js.map +1 -0
- package/admin/presentation/AiPowerUpsSettings/feature.d.ts +3 -0
- package/admin/presentation/AiPowerUpsSettings/feature.js +29 -0
- package/admin/presentation/AiPowerUpsSettings/feature.js.map +1 -0
- package/admin/presentation/AiPowerUpsSettings/hasUsableModel.d.ts +13 -0
- package/admin/presentation/AiPowerUpsSettings/hasUsableModel.js +9 -0
- package/admin/presentation/AiPowerUpsSettings/hasUsableModel.js.map +1 -0
- package/admin/presentation/AiPowerUpsSettings/index.d.ts +4 -0
- package/admin/presentation/AiPowerUpsSettings/index.js +4 -0
- package/admin/presentation/AiPowerUpsSettings/settingsGroup.d.ts +26 -0
- package/admin/presentation/AiPowerUpsSettings/settingsGroup.js +5 -0
- package/admin/presentation/AiPowerUpsSettings/settingsGroup.js.map +1 -0
- package/admin/presentation/AiPowerUpsSettings/useAiPowerUpsSettings.d.ts +4 -0
- package/admin/presentation/AiPowerUpsSettings/useAiPowerUpsSettings.js +27 -0
- package/admin/presentation/AiPowerUpsSettings/useAiPowerUpsSettings.js.map +1 -0
- package/admin/presentation/AiPromptFormFactory/AiPromptFormFactory.d.ts +20 -0
- package/admin/presentation/AiPromptFormFactory/AiPromptFormFactory.js +108 -0
- package/admin/presentation/AiPromptFormFactory/AiPromptFormFactory.js.map +1 -0
- package/admin/presentation/AiPromptFormFactory/abstractions.d.ts +14 -0
- package/admin/presentation/AiPromptFormFactory/abstractions.js +5 -0
- package/admin/presentation/AiPromptFormFactory/abstractions.js.map +1 -0
- package/admin/presentation/AiPromptFormFactory/feature.d.ts +1 -0
- package/admin/presentation/AiPromptFormFactory/feature.js +11 -0
- package/admin/presentation/AiPromptFormFactory/feature.js.map +1 -0
- package/admin/presentation/CapabilitiesSettings.d.ts +39 -0
- package/admin/presentation/CapabilitiesSettings.js +104 -0
- package/admin/presentation/CapabilitiesSettings.js.map +1 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDialog.d.ts +9 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDialog.js +118 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDialog.js.map +1 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDrawer.d.ts +9 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDrawer.js +72 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDrawer.js.map +1 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsMenuItem.d.ts +4 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsMenuItem.js +21 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsMenuItem.js.map +1 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsOverlays.d.ts +2 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsOverlays.js +17 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsOverlays.js.map +1 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsPresenter.d.ts +25 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsPresenter.js +90 -0
- package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsPresenter.js.map +1 -0
- package/admin/presentation/CmsCompareEntryRevisions/Extension.d.ts +2 -0
- package/admin/presentation/CmsCompareEntryRevisions/Extension.js +16 -0
- package/admin/presentation/CmsCompareEntryRevisions/Extension.js.map +1 -0
- package/admin/presentation/CmsCompareEntryRevisions/abstractions.d.ts +29 -0
- package/admin/presentation/CmsCompareEntryRevisions/abstractions.js +5 -0
- package/admin/presentation/CmsCompareEntryRevisions/abstractions.js.map +1 -0
- package/admin/presentation/CmsCompareEntryRevisions/feature.d.ts +3 -0
- package/admin/presentation/CmsCompareEntryRevisions/feature.js +17 -0
- package/admin/presentation/CmsCompareEntryRevisions/feature.js.map +1 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.d.ts +4 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.js +27 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.js.map +1 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.d.ts +5 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.js +106 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.js.map +1 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.d.ts +29 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.js +120 -0
- package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.js.map +1 -0
- package/admin/presentation/CmsContentGeneration/Extension.d.ts +2 -0
- package/admin/presentation/CmsContentGeneration/Extension.js +27 -0
- package/admin/presentation/CmsContentGeneration/Extension.js.map +1 -0
- package/admin/presentation/CmsContentGeneration/abstractions.d.ts +20 -0
- package/admin/presentation/CmsContentGeneration/abstractions.js +5 -0
- package/admin/presentation/CmsContentGeneration/abstractions.js.map +1 -0
- package/admin/presentation/CmsContentGeneration/feature.d.ts +3 -0
- package/admin/presentation/CmsContentGeneration/feature.js +17 -0
- package/admin/presentation/CmsContentGeneration/feature.js.map +1 -0
- package/admin/presentation/CmsEntryWizard/CmsEntryWizard.d.ts +4 -0
- package/admin/presentation/CmsEntryWizard/CmsEntryWizard.js +113 -0
- package/admin/presentation/CmsEntryWizard/CmsEntryWizard.js.map +1 -0
- package/admin/presentation/CmsEntryWizard/CmsEntryWizardGate.d.ts +4 -0
- package/admin/presentation/CmsEntryWizard/CmsEntryWizardGate.js +22 -0
- package/admin/presentation/CmsEntryWizard/CmsEntryWizardGate.js.map +1 -0
- package/admin/presentation/CmsEntryWizard/Extension.d.ts +2 -0
- package/admin/presentation/CmsEntryWizard/Extension.js +10 -0
- package/admin/presentation/CmsEntryWizard/Extension.js.map +1 -0
- package/admin/presentation/ConnectionsSettings.d.ts +25 -0
- package/admin/presentation/ConnectionsSettings.js +52 -0
- package/admin/presentation/ConnectionsSettings.js.map +1 -0
- package/admin/presentation/ModelRolesSettings.d.ts +29 -0
- package/admin/presentation/ModelRolesSettings.js +67 -0
- package/admin/presentation/ModelRolesSettings.js.map +1 -0
- package/admin/presentation/ProjectsSettings.d.ts +11 -0
- package/admin/presentation/ProjectsSettings.js +56 -0
- package/admin/presentation/ProjectsSettings.js.map +1 -0
- package/admin/presentation/ProvidersSettings.d.ts +16 -0
- package/admin/presentation/ProvidersSettings.js +46 -0
- package/admin/presentation/ProvidersSettings.js.map +1 -0
- package/admin/presentation/ReaderPersonasSettings.d.ts +11 -0
- package/admin/presentation/ReaderPersonasSettings.js +37 -0
- package/admin/presentation/ReaderPersonasSettings.js.map +1 -0
- package/admin/presentation/WbContentGeneration/Extension.d.ts +2 -0
- package/admin/presentation/WbContentGeneration/Extension.js +22 -0
- package/admin/presentation/WbContentGeneration/Extension.js.map +1 -0
- package/admin/presentation/WbContentGeneration/GenerateContentButton.d.ts +2 -0
- package/admin/presentation/WbContentGeneration/GenerateContentButton.js +19 -0
- package/admin/presentation/WbContentGeneration/GenerateContentButton.js.map +1 -0
- package/admin/presentation/WbContentGeneration/GenerateContentDialog.d.ts +21 -0
- package/admin/presentation/WbContentGeneration/GenerateContentDialog.js +125 -0
- package/admin/presentation/WbContentGeneration/GenerateContentDialog.js.map +1 -0
- package/admin/presentation/WbContentGeneration/GenerateContentPresenter.d.ts +33 -0
- package/admin/presentation/WbContentGeneration/GenerateContentPresenter.js +161 -0
- package/admin/presentation/WbContentGeneration/GenerateContentPresenter.js.map +1 -0
- package/admin/presentation/WbContentGeneration/PROCESS_IDEA.md +190 -0
- package/admin/presentation/WbContentGeneration/abstractions.d.ts +31 -0
- package/admin/presentation/WbContentGeneration/abstractions.js +5 -0
- package/admin/presentation/WbContentGeneration/abstractions.js.map +1 -0
- package/admin/presentation/WbContentGeneration/decompressGzipBase64.d.ts +1 -0
- package/admin/presentation/WbContentGeneration/decompressGzipBase64.js +13 -0
- package/admin/presentation/WbContentGeneration/decompressGzipBase64.js.map +1 -0
- package/admin/presentation/WbContentGeneration/feature.d.ts +3 -0
- package/admin/presentation/WbContentGeneration/feature.js +17 -0
- package/admin/presentation/WbContentGeneration/feature.js.map +1 -0
- package/admin/presentation/WriterPersonasSettings.d.ts +11 -0
- package/admin/presentation/WriterPersonasSettings.js +37 -0
- package/admin/presentation/WriterPersonasSettings.js.map +1 -0
- package/admin/presentation/modelRoles.d.ts +10 -0
- package/admin/presentation/modelRoles.js +23 -0
- package/admin/presentation/modelRoles.js.map +1 -0
- package/admin/routes.d.ts +4 -0
- package/admin/routes.js +10 -0
- package/admin/routes.js.map +1 -0
- package/api/Extension.d.ts +4 -0
- package/api/Extension.js +68 -0
- package/api/Extension.js.map +1 -0
- package/api/constants.d.ts +1 -0
- package/api/constants.js +4 -0
- package/api/constants.js.map +1 -0
- package/api/features/AdminAssistant/AdminAssistantStreamRoute.d.ts +34 -0
- package/api/features/AdminAssistant/AdminAssistantStreamRoute.js +42 -0
- package/api/features/AdminAssistant/AdminAssistantStreamRoute.js.map +1 -0
- package/api/features/AdminAssistant/AdminAssistantUseCase.d.ts +42 -0
- package/api/features/AdminAssistant/AdminAssistantUseCase.js +170 -0
- package/api/features/AdminAssistant/AdminAssistantUseCase.js.map +1 -0
- package/api/features/AdminAssistant/abstractions.d.ts +38 -0
- package/api/features/AdminAssistant/abstractions.js +6 -0
- package/api/features/AdminAssistant/abstractions.js.map +1 -0
- package/api/features/AdminAssistant/approvals.d.ts +29 -0
- package/api/features/AdminAssistant/approvals.js +30 -0
- package/api/features/AdminAssistant/approvals.js.map +1 -0
- package/api/features/AdminAssistant/capability.d.ts +31 -0
- package/api/features/AdminAssistant/capability.js +19 -0
- package/api/features/AdminAssistant/capability.js.map +1 -0
- package/api/features/AdminAssistant/events.d.ts +54 -0
- package/api/features/AdminAssistant/events.js +0 -0
- package/api/features/AdminAssistant/feature.d.ts +12 -0
- package/api/features/AdminAssistant/feature.js +23 -0
- package/api/features/AdminAssistant/feature.js.map +1 -0
- package/api/features/AdminAssistant/index.d.ts +5 -0
- package/api/features/AdminAssistant/index.js +3 -0
- package/api/features/AdminAssistant/parseChatBody.d.ts +14 -0
- package/api/features/AdminAssistant/parseChatBody.js +33 -0
- package/api/features/AdminAssistant/parseChatBody.js.map +1 -0
- package/api/features/AdminAssistant/systemPrompt.d.ts +7 -0
- package/api/features/AdminAssistant/systemPrompt.js +24 -0
- package/api/features/AdminAssistant/systemPrompt.js.map +1 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentAfterCreateHandler.d.ts +11 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentAfterCreateHandler.js +27 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentAfterCreateHandler.js.map +1 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentStreamRoute.d.ts +36 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentStreamRoute.js +92 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentStreamRoute.js.map +1 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentTask.d.ts +41 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentTask.js +95 -0
- package/api/features/AiImageEnrichment/AiImageEnrichmentTask.js.map +1 -0
- package/api/features/AiImageEnrichment/ApplyImageEnrichmentUseCase.d.ts +18 -0
- package/api/features/AiImageEnrichment/ApplyImageEnrichmentUseCase.js +50 -0
- package/api/features/AiImageEnrichment/ApplyImageEnrichmentUseCase.js.map +1 -0
- package/api/features/AiImageEnrichment/EnrichmentCapabilityDisabledError.d.ts +9 -0
- package/api/features/AiImageEnrichment/EnrichmentCapabilityDisabledError.js +8 -0
- package/api/features/AiImageEnrichment/EnrichmentCapabilityDisabledError.js.map +1 -0
- package/api/features/AiImageEnrichment/PrepareImageEnrichmentUseCase.d.ts +17 -0
- package/api/features/AiImageEnrichment/PrepareImageEnrichmentUseCase.js +47 -0
- package/api/features/AiImageEnrichment/PrepareImageEnrichmentUseCase.js.map +1 -0
- package/api/features/AiImageEnrichment/abstractions.d.ts +66 -0
- package/api/features/AiImageEnrichment/abstractions.js +12 -0
- package/api/features/AiImageEnrichment/abstractions.js.map +1 -0
- package/api/features/AiImageEnrichment/buildEnrichmentAiRequest.d.ts +12 -0
- package/api/features/AiImageEnrichment/buildEnrichmentAiRequest.js +30 -0
- package/api/features/AiImageEnrichment/buildEnrichmentAiRequest.js.map +1 -0
- package/api/features/AiImageEnrichment/capability.d.ts +18 -0
- package/api/features/AiImageEnrichment/capability.js +19 -0
- package/api/features/AiImageEnrichment/capability.js.map +1 -0
- package/api/features/AiImageEnrichment/errors.d.ts +33 -0
- package/api/features/AiImageEnrichment/errors.js +29 -0
- package/api/features/AiImageEnrichment/errors.js.map +1 -0
- package/api/features/AiImageEnrichment/feature.d.ts +4 -0
- package/api/features/AiImageEnrichment/feature.js +24 -0
- package/api/features/AiImageEnrichment/feature.js.map +1 -0
- package/api/features/AiImageEnrichment/imageEnrichmentErrorStatusCode.d.ts +6 -0
- package/api/features/AiImageEnrichment/imageEnrichmentErrorStatusCode.js +10 -0
- package/api/features/AiImageEnrichment/imageEnrichmentErrorStatusCode.js.map +1 -0
- package/api/features/AiImageEnrichment/readEnrichmentPartial.d.ts +8 -0
- package/api/features/AiImageEnrichment/readEnrichmentPartial.js +16 -0
- package/api/features/AiImageEnrichment/readEnrichmentPartial.js.map +1 -0
- package/api/features/AiImageEnrichment/streamEvents.d.ts +36 -0
- package/api/features/AiImageEnrichment/streamEvents.js +0 -0
- package/api/features/AiPromptContext/AiPromptContextBuilder.d.ts +19 -0
- package/api/features/AiPromptContext/AiPromptContextBuilder.js +147 -0
- package/api/features/AiPromptContext/AiPromptContextBuilder.js.map +1 -0
- package/api/features/AiPromptContext/ProjectFileAssembler.d.ts +22 -0
- package/api/features/AiPromptContext/ProjectFileAssembler.js +76 -0
- package/api/features/AiPromptContext/ProjectFileAssembler.js.map +1 -0
- package/api/features/AiPromptContext/ProjectFileCache.d.ts +16 -0
- package/api/features/AiPromptContext/ProjectFileCache.js +61 -0
- package/api/features/AiPromptContext/ProjectFileCache.js.map +1 -0
- package/api/features/AiPromptContext/ProjectSection.d.ts +4 -0
- package/api/features/AiPromptContext/ProjectSection.js +35 -0
- package/api/features/AiPromptContext/ProjectSection.js.map +1 -0
- package/api/features/AiPromptContext/ReadProjectFileTool.d.ts +3 -0
- package/api/features/AiPromptContext/ReadProjectFileTool.js +36 -0
- package/api/features/AiPromptContext/ReadProjectFileTool.js.map +1 -0
- package/api/features/AiPromptContext/ReaderPersonaSection.d.ts +4 -0
- package/api/features/AiPromptContext/ReaderPersonaSection.js +10 -0
- package/api/features/AiPromptContext/ReaderPersonaSection.js.map +1 -0
- package/api/features/AiPromptContext/WriterPersonaSection.d.ts +4 -0
- package/api/features/AiPromptContext/WriterPersonaSection.js +10 -0
- package/api/features/AiPromptContext/WriterPersonaSection.js.map +1 -0
- package/api/features/AiPromptContext/abstractions.d.ts +71 -0
- package/api/features/AiPromptContext/abstractions.js +15 -0
- package/api/features/AiPromptContext/abstractions.js.map +1 -0
- package/api/features/AiPromptContext/feature.d.ts +4 -0
- package/api/features/AiPromptContext/feature.js +15 -0
- package/api/features/AiPromptContext/feature.js.map +1 -0
- package/api/features/AiPromptContext/index.d.ts +1 -0
- package/api/features/AiPromptContext/index.js +1 -0
- package/api/features/Capabilities/AiCapabilityDisabledError.d.ts +16 -0
- package/api/features/Capabilities/AiCapabilityDisabledError.js +8 -0
- package/api/features/Capabilities/AiCapabilityDisabledError.js.map +1 -0
- package/api/features/Capabilities/AiModelNotAvailableError.d.ts +13 -0
- package/api/features/Capabilities/AiModelNotAvailableError.js +8 -0
- package/api/features/Capabilities/AiModelNotAvailableError.js.map +1 -0
- package/api/features/Capabilities/CapabilitiesHandler.d.ts +28 -0
- package/api/features/Capabilities/CapabilitiesHandler.js +56 -0
- package/api/features/Capabilities/CapabilitiesHandler.js.map +1 -0
- package/api/features/Capabilities/ListAiCapabilitiesUseCase.d.ts +18 -0
- package/api/features/Capabilities/ListAiCapabilitiesUseCase.js +28 -0
- package/api/features/Capabilities/ListAiCapabilitiesUseCase.js.map +1 -0
- package/api/features/Capabilities/ResolveAiCapabilityUseCase.d.ts +33 -0
- package/api/features/Capabilities/ResolveAiCapabilityUseCase.js +114 -0
- package/api/features/Capabilities/ResolveAiCapabilityUseCase.js.map +1 -0
- package/api/features/Capabilities/abstractions.d.ts +90 -0
- package/api/features/Capabilities/abstractions.js +7 -0
- package/api/features/Capabilities/abstractions.js.map +1 -0
- package/api/features/Capabilities/composeSystemPrompt.d.ts +14 -0
- package/api/features/Capabilities/composeSystemPrompt.js +13 -0
- package/api/features/Capabilities/composeSystemPrompt.js.map +1 -0
- package/api/features/Capabilities/feature.d.ts +4 -0
- package/api/features/Capabilities/feature.js +15 -0
- package/api/features/Capabilities/feature.js.map +1 -0
- package/api/features/Capabilities/index.d.ts +7 -0
- package/api/features/Capabilities/index.js +5 -0
- package/api/features/Capabilities/types.d.ts +86 -0
- package/api/features/Capabilities/types.js +4 -0
- package/api/features/Capabilities/types.js.map +1 -0
- package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.d.ts +20 -0
- package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.js +82 -0
- package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.js.map +1 -0
- package/api/features/CmsCompareEntryRevisions/abstractions.d.ts +18 -0
- package/api/features/CmsCompareEntryRevisions/abstractions.js +5 -0
- package/api/features/CmsCompareEntryRevisions/abstractions.js.map +1 -0
- package/api/features/CmsCompareEntryRevisions/capability.d.ts +13 -0
- package/api/features/CmsCompareEntryRevisions/capability.js +64 -0
- package/api/features/CmsCompareEntryRevisions/capability.js.map +1 -0
- package/api/features/CmsCompareEntryRevisions/feature.d.ts +4 -0
- package/api/features/CmsCompareEntryRevisions/feature.js +13 -0
- package/api/features/CmsCompareEntryRevisions/feature.js.map +1 -0
- package/api/features/CmsCompareEntryRevisions/index.d.ts +2 -0
- package/api/features/CmsCompareEntryRevisions/index.js +2 -0
- package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.d.ts +38 -0
- package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js +93 -0
- package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js.map +1 -0
- package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.d.ts +27 -0
- package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.js +133 -0
- package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.js.map +1 -0
- package/api/features/CmsGenerateEntryContent/abstractions.d.ts +36 -0
- package/api/features/CmsGenerateEntryContent/abstractions.js +5 -0
- package/api/features/CmsGenerateEntryContent/abstractions.js.map +1 -0
- package/api/features/CmsGenerateEntryContent/buildPrompt.d.ts +2 -0
- package/api/features/CmsGenerateEntryContent/buildPrompt.js +61 -0
- package/api/features/CmsGenerateEntryContent/buildPrompt.js.map +1 -0
- package/api/features/CmsGenerateEntryContent/capability.d.ts +17 -0
- package/api/features/CmsGenerateEntryContent/capability.js +17 -0
- package/api/features/CmsGenerateEntryContent/capability.js.map +1 -0
- package/api/features/CmsGenerateEntryContent/feature.d.ts +4 -0
- package/api/features/CmsGenerateEntryContent/feature.js +15 -0
- package/api/features/CmsGenerateEntryContent/feature.js.map +1 -0
- package/api/features/CmsGenerateEntryContent/index.d.ts +1 -0
- package/api/features/CmsGenerateEntryContent/index.js +1 -0
- package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.d.ts +2 -0
- package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.js +30 -0
- package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.js.map +1 -0
- package/api/features/CmsResolveImageTool/CmsResolveImageTool.d.ts +14 -0
- package/api/features/CmsResolveImageTool/CmsResolveImageTool.js +27 -0
- package/api/features/CmsResolveImageTool/CmsResolveImageTool.js.map +1 -0
- package/api/features/CmsResolveImageTool/feature.d.ts +4 -0
- package/api/features/CmsResolveImageTool/feature.js +11 -0
- package/api/features/CmsResolveImageTool/feature.js.map +1 -0
- package/api/features/ConfiguredAiModels/ConfiguredAiModelsService.d.ts +18 -0
- package/api/features/ConfiguredAiModels/ConfiguredAiModelsService.js +92 -0
- package/api/features/ConfiguredAiModels/ConfiguredAiModelsService.js.map +1 -0
- package/api/features/ConfiguredAiModels/abstractions.d.ts +32 -0
- package/api/features/ConfiguredAiModels/abstractions.js +5 -0
- package/api/features/ConfiguredAiModels/abstractions.js.map +1 -0
- package/api/features/ConfiguredAiModels/feature.d.ts +4 -0
- package/api/features/ConfiguredAiModels/feature.js +11 -0
- package/api/features/ConfiguredAiModels/feature.js.map +1 -0
- package/api/features/ConfiguredAiModels/index.d.ts +2 -0
- package/api/features/ConfiguredAiModels/index.js +1 -0
- package/api/features/Connections/ConnectionsGraphQLMapper.d.ts +20 -0
- package/api/features/Connections/ConnectionsGraphQLMapper.js +37 -0
- package/api/features/Connections/ConnectionsGraphQLMapper.js.map +1 -0
- package/api/features/Connections/ConnectionsHandler.d.ts +25 -0
- package/api/features/Connections/ConnectionsHandler.js +84 -0
- package/api/features/Connections/ConnectionsHandler.js.map +1 -0
- package/api/features/Connections/feature.d.ts +4 -0
- package/api/features/Connections/feature.js +13 -0
- package/api/features/Connections/feature.js.map +1 -0
- package/api/features/Connections/index.d.ts +2 -0
- package/api/features/Connections/index.js +1 -0
- package/api/features/Connections/legacyProviders.d.ts +26 -0
- package/api/features/Connections/legacyProviders.js +9 -0
- package/api/features/Connections/legacyProviders.js.map +1 -0
- package/api/features/Connections/types.d.ts +36 -0
- package/api/features/Connections/types.js +0 -0
- package/api/features/ExtractFrontmatter/ExtractFrontmatterBeforeCreateHandler.d.ts +11 -0
- package/api/features/ExtractFrontmatter/ExtractFrontmatterBeforeCreateHandler.js +34 -0
- package/api/features/ExtractFrontmatter/ExtractFrontmatterBeforeCreateHandler.js.map +1 -0
- package/api/features/ExtractFrontmatter/feature.d.ts +4 -0
- package/api/features/ExtractFrontmatter/feature.js +11 -0
- package/api/features/ExtractFrontmatter/feature.js.map +1 -0
- package/api/features/GetSettings/GetSettingsRepository.d.ts +16 -0
- package/api/features/GetSettings/GetSettingsRepository.js +40 -0
- package/api/features/GetSettings/GetSettingsRepository.js.map +1 -0
- package/api/features/GetSettings/GetSettingsUseCase.d.ts +10 -0
- package/api/features/GetSettings/GetSettingsUseCase.js +18 -0
- package/api/features/GetSettings/GetSettingsUseCase.js.map +1 -0
- package/api/features/GetSettings/abstractions.d.ts +16 -0
- package/api/features/GetSettings/abstractions.js +6 -0
- package/api/features/GetSettings/abstractions.js.map +1 -0
- package/api/features/GetSettings/feature.d.ts +4 -0
- package/api/features/GetSettings/feature.js +13 -0
- package/api/features/GetSettings/feature.js.map +1 -0
- package/api/features/GetSettings/index.d.ts +2 -0
- package/api/features/GetSettings/index.js +2 -0
- package/api/features/ModelRoles/ModelRolesHandler.d.ts +15 -0
- package/api/features/ModelRoles/ModelRolesHandler.js +74 -0
- package/api/features/ModelRoles/ModelRolesHandler.js.map +1 -0
- package/api/features/ModelRoles/feature.d.ts +4 -0
- package/api/features/ModelRoles/feature.js +11 -0
- package/api/features/ModelRoles/feature.js.map +1 -0
- package/api/features/ModelRoles/index.d.ts +4 -0
- package/api/features/ModelRoles/index.js +2 -0
- package/api/features/ModelRoles/roles.d.ts +16 -0
- package/api/features/ModelRoles/roles.js +9 -0
- package/api/features/ModelRoles/roles.js.map +1 -0
- package/api/features/ModelRoles/types.d.ts +21 -0
- package/api/features/ModelRoles/types.js +7 -0
- package/api/features/ModelRoles/types.js.map +1 -0
- package/api/features/Projects/ProjectsHandler.d.ts +31 -0
- package/api/features/Projects/ProjectsHandler.js +103 -0
- package/api/features/Projects/ProjectsHandler.js.map +1 -0
- package/api/features/Projects/feature.d.ts +4 -0
- package/api/features/Projects/feature.js +11 -0
- package/api/features/Projects/feature.js.map +1 -0
- package/api/features/Projects/types.d.ts +50 -0
- package/api/features/Projects/types.js +0 -0
- package/api/features/Providers/ProvidersGraphQLMapper.d.ts +21 -0
- package/api/features/Providers/ProvidersGraphQLMapper.js +39 -0
- package/api/features/Providers/ProvidersGraphQLMapper.js.map +1 -0
- package/api/features/Providers/ProvidersHandler.d.ts +26 -0
- package/api/features/Providers/ProvidersHandler.js +79 -0
- package/api/features/Providers/ProvidersHandler.js.map +1 -0
- package/api/features/Providers/feature.d.ts +4 -0
- package/api/features/Providers/feature.js +13 -0
- package/api/features/Providers/feature.js.map +1 -0
- package/api/features/Providers/index.d.ts +1 -0
- package/api/features/Providers/index.js +0 -0
- package/api/features/Providers/types.d.ts +29 -0
- package/api/features/Providers/types.js +0 -0
- package/api/features/ReaderPersonas/ReaderPersonasHandler.d.ts +20 -0
- package/api/features/ReaderPersonas/ReaderPersonasHandler.js +43 -0
- package/api/features/ReaderPersonas/ReaderPersonasHandler.js.map +1 -0
- package/api/features/ReaderPersonas/feature.d.ts +4 -0
- package/api/features/ReaderPersonas/feature.js +11 -0
- package/api/features/ReaderPersonas/feature.js.map +1 -0
- package/api/features/ReaderPersonas/index.d.ts +2 -0
- package/api/features/ReaderPersonas/index.js +1 -0
- package/api/features/ReaderPersonas/types.d.ts +24 -0
- package/api/features/ReaderPersonas/types.js +0 -0
- package/api/features/UpdateSettings/UpdateSettingsRepository.d.ts +16 -0
- package/api/features/UpdateSettings/UpdateSettingsRepository.js +71 -0
- package/api/features/UpdateSettings/UpdateSettingsRepository.js.map +1 -0
- package/api/features/UpdateSettings/UpdateSettingsUseCase.d.ts +13 -0
- package/api/features/UpdateSettings/UpdateSettingsUseCase.js +30 -0
- package/api/features/UpdateSettings/UpdateSettingsUseCase.js.map +1 -0
- package/api/features/UpdateSettings/abstractions.d.ts +36 -0
- package/api/features/UpdateSettings/abstractions.js +8 -0
- package/api/features/UpdateSettings/abstractions.js.map +1 -0
- package/api/features/UpdateSettings/errors.d.ts +10 -0
- package/api/features/UpdateSettings/errors.js +14 -0
- package/api/features/UpdateSettings/errors.js.map +1 -0
- package/api/features/UpdateSettings/events.d.ts +10 -0
- package/api/features/UpdateSettings/events.js +21 -0
- package/api/features/UpdateSettings/events.js.map +1 -0
- package/api/features/UpdateSettings/feature.d.ts +4 -0
- package/api/features/UpdateSettings/feature.js +13 -0
- package/api/features/UpdateSettings/feature.js.map +1 -0
- package/api/features/UpdateSettings/index.d.ts +1 -0
- package/api/features/UpdateSettings/index.js +1 -0
- package/api/features/WbGeneratePageContent/ComponentFilter.d.ts +18 -0
- package/api/features/WbGeneratePageContent/ComponentFilter.js +69 -0
- package/api/features/WbGeneratePageContent/ComponentFilter.js.map +1 -0
- package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.d.ts +39 -0
- package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.js +94 -0
- package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.js.map +1 -0
- package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.d.ts +21 -0
- package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.js +113 -0
- package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.js.map +1 -0
- package/api/features/WbGeneratePageContent/abstractions.d.ts +31 -0
- package/api/features/WbGeneratePageContent/abstractions.js +5 -0
- package/api/features/WbGeneratePageContent/abstractions.js.map +1 -0
- package/api/features/WbGeneratePageContent/buildPrompt.d.ts +3 -0
- package/api/features/WbGeneratePageContent/buildPrompt.js +158 -0
- package/api/features/WbGeneratePageContent/buildPrompt.js.map +1 -0
- package/api/features/WbGeneratePageContent/capability.d.ts +16 -0
- package/api/features/WbGeneratePageContent/capability.js +17 -0
- package/api/features/WbGeneratePageContent/capability.js.map +1 -0
- package/api/features/WbGeneratePageContent/feature.d.ts +4 -0
- package/api/features/WbGeneratePageContent/feature.js +15 -0
- package/api/features/WbGeneratePageContent/feature.js.map +1 -0
- package/api/features/WbGeneratePageContent/index.d.ts +1 -0
- package/api/features/WbGeneratePageContent/index.js +1 -0
- package/api/features/WbTranslatePage/LexicalParser.d.ts +10 -0
- package/api/features/WbTranslatePage/LexicalParser.js +37 -0
- package/api/features/WbTranslatePage/LexicalParser.js.map +1 -0
- package/api/features/WbTranslatePage/WbTranslateLayoutDecorator.d.ts +44 -0
- package/api/features/WbTranslatePage/WbTranslateLayoutDecorator.js +185 -0
- package/api/features/WbTranslatePage/WbTranslateLayoutDecorator.js.map +1 -0
- package/api/features/WbTranslatePage/WbTranslatePageDecorator.d.ts +38 -0
- package/api/features/WbTranslatePage/WbTranslatePageDecorator.js +163 -0
- package/api/features/WbTranslatePage/WbTranslatePageDecorator.js.map +1 -0
- package/api/features/WbTranslatePage/abstractions/LexicalParser.d.ts +7 -0
- package/api/features/WbTranslatePage/abstractions/LexicalParser.js +5 -0
- package/api/features/WbTranslatePage/abstractions/LexicalParser.js.map +1 -0
- package/api/features/WbTranslatePage/capability.d.ts +13 -0
- package/api/features/WbTranslatePage/capability.js +19 -0
- package/api/features/WbTranslatePage/capability.js.map +1 -0
- package/api/features/WbTranslatePage/feature.d.ts +4 -0
- package/api/features/WbTranslatePage/feature.js +20 -0
- package/api/features/WbTranslatePage/feature.js.map +1 -0
- package/api/features/WbTranslatePage/index.d.ts +2 -0
- package/api/features/WbTranslatePage/index.js +2 -0
- package/api/features/WbTranslatePage/translatableBindings.d.ts +21 -0
- package/api/features/WbTranslatePage/translatableBindings.js +57 -0
- package/api/features/WbTranslatePage/translatableBindings.js.map +1 -0
- package/api/features/WbTranslatePage/translatableGlobals.d.ts +21 -0
- package/api/features/WbTranslatePage/translatableGlobals.js +29 -0
- package/api/features/WbTranslatePage/translatableGlobals.js.map +1 -0
- package/api/features/WorkflowReview/AiStepRunner/AiStepRunner.d.ts +41 -0
- package/api/features/WorkflowReview/AiStepRunner/AiStepRunner.js +253 -0
- package/api/features/WorkflowReview/AiStepRunner/AiStepRunner.js.map +1 -0
- package/api/features/WorkflowReview/AiStepRunner/aiRunFailureReasons.d.ts +4 -0
- package/api/features/WorkflowReview/AiStepRunner/aiRunFailureReasons.js +7 -0
- package/api/features/WorkflowReview/AiStepRunner/aiRunFailureReasons.js.map +1 -0
- package/api/features/WorkflowReview/AiStepRunner/feature.d.ts +5 -0
- package/api/features/WorkflowReview/AiStepRunner/feature.js +11 -0
- package/api/features/WorkflowReview/AiStepRunner/feature.js.map +1 -0
- package/api/features/WorkflowReview/AiStepType/AiStepType.d.ts +53 -0
- package/api/features/WorkflowReview/AiStepType/AiStepType.js +121 -0
- package/api/features/WorkflowReview/AiStepType/AiStepType.js.map +1 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/ListWorkflowAiModelsUseCase.d.ts +17 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/ListWorkflowAiModelsUseCase.js +61 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/ListWorkflowAiModelsUseCase.js.map +1 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/abstractions.d.ts +32 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/abstractions.js +5 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/abstractions.js.map +1 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/feature.d.ts +4 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/feature.js +11 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/feature.js.map +1 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/index.d.ts +2 -0
- package/api/features/WorkflowReview/ListWorkflowAiModels/index.js +1 -0
- package/api/features/WorkflowReview/WorkflowsReviewCapability.d.ts +12 -0
- package/api/features/WorkflowReview/WorkflowsReviewCapability.js +38 -0
- package/api/features/WorkflowReview/WorkflowsReviewCapability.js.map +1 -0
- package/api/features/WorkflowReview/aiFailureReasons.d.ts +11 -0
- package/api/features/WorkflowReview/aiFailureReasons.js +9 -0
- package/api/features/WorkflowReview/aiFailureReasons.js.map +1 -0
- package/api/features/WorkflowReview/aiReviewOutputSchema.d.ts +29 -0
- package/api/features/WorkflowReview/aiReviewOutputSchema.js +28 -0
- package/api/features/WorkflowReview/aiReviewOutputSchema.js.map +1 -0
- package/api/features/WorkflowReview/aiStepConfigSchema.d.ts +13 -0
- package/api/features/WorkflowReview/aiStepConfigSchema.js +11 -0
- package/api/features/WorkflowReview/aiStepConfigSchema.js.map +1 -0
- package/api/features/WorkflowReview/buildAiStepPrompt.d.ts +35 -0
- package/api/features/WorkflowReview/buildAiStepPrompt.js +47 -0
- package/api/features/WorkflowReview/buildAiStepPrompt.js.map +1 -0
- package/api/features/WorkflowReview/constants.d.ts +8 -0
- package/api/features/WorkflowReview/constants.js +7 -0
- package/api/features/WorkflowReview/constants.js.map +1 -0
- package/api/features/WorkflowReview/toLoggedAiError.d.ts +13 -0
- package/api/features/WorkflowReview/toLoggedAiError.js +27 -0
- package/api/features/WorkflowReview/toLoggedAiError.js.map +1 -0
- package/api/features/WriterPersonas/WriterPersonasHandler.d.ts +20 -0
- package/api/features/WriterPersonas/WriterPersonasHandler.js +43 -0
- package/api/features/WriterPersonas/WriterPersonasHandler.js.map +1 -0
- package/api/features/WriterPersonas/feature.d.ts +4 -0
- package/api/features/WriterPersonas/feature.js +11 -0
- package/api/features/WriterPersonas/feature.js.map +1 -0
- package/api/features/WriterPersonas/index.d.ts +2 -0
- package/api/features/WriterPersonas/index.js +1 -0
- package/api/features/WriterPersonas/types.d.ts +24 -0
- package/api/features/WriterPersonas/types.js +0 -0
- package/api/features/shared/SettingsCache.d.ts +12 -0
- package/api/features/shared/SettingsCache.js +22 -0
- package/api/features/shared/SettingsCache.js.map +1 -0
- package/api/features/shared/abstractions.d.ts +38 -0
- package/api/features/shared/abstractions.js +7 -0
- package/api/features/shared/abstractions.js.map +1 -0
- package/api/features/shared/index.d.ts +3 -0
- package/api/features/shared/index.js +1 -0
- package/api/features/shared/modelId.d.ts +11 -0
- package/api/features/shared/modelId.js +4 -0
- package/api/features/shared/modelId.js.map +1 -0
- package/api/graphql/AiPowerUpsSettingsGraphQLMapper.d.ts +13 -0
- package/api/graphql/AiPowerUpsSettingsGraphQLMapper.js +44 -0
- package/api/graphql/AiPowerUpsSettingsGraphQLMapper.js.map +1 -0
- package/api/graphql/BaseGraphQLSchema.d.ts +9 -0
- package/api/graphql/BaseGraphQLSchema.js +194 -0
- package/api/graphql/BaseGraphQLSchema.js.map +1 -0
- package/api/graphql/CmsCompareEntryRevisionsSchema.d.ts +9 -0
- package/api/graphql/CmsCompareEntryRevisionsSchema.js +72 -0
- package/api/graphql/CmsCompareEntryRevisionsSchema.js.map +1 -0
- package/api/graphql/ListWorkflowAiModelsSchema.d.ts +15 -0
- package/api/graphql/ListWorkflowAiModelsSchema.js +48 -0
- package/api/graphql/ListWorkflowAiModelsSchema.js.map +1 -0
- package/api/graphql/abstractions.d.ts +9 -0
- package/api/graphql/abstractions.js +5 -0
- package/api/graphql/abstractions.js.map +1 -0
- package/api/types.d.ts +8 -0
- package/api/types.js +6 -0
- package/domain/LlmJsonResponse.d.ts +8 -0
- package/domain/LlmJsonResponse.js +38 -0
- package/domain/LlmJsonResponse.js.map +1 -0
- package/domain/TranslatableBindingKey.d.ts +17 -0
- package/domain/TranslatableBindingKey.js +23 -0
- package/domain/TranslatableBindingKey.js.map +1 -0
- package/exports/admin/ai-powerups.d.ts +1 -0
- package/exports/admin/ai-powerups.js +1 -0
- package/exports/api/ai-powerups.d.ts +7 -0
- package/exports/api/ai-powerups.js +5 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AiCapability, ListAiCapabilitiesUseCase, ResolveAiCapabilityUseCase } from "./abstractions.js";
|
|
2
|
+
export { withAdditionalInstructions } from "./composeSystemPrompt.js";
|
|
3
|
+
export { AiCapabilityDisabledError } from "./AiCapabilityDisabledError.js";
|
|
4
|
+
export { AiModelNotAvailableError } from "./AiModelNotAvailableError.js";
|
|
5
|
+
export { CapabilitiesFeature } from "./feature.js";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { IAiPowerUpsSettings } from "../../../api/types.js";
|
|
2
|
+
import type { AiModelRoleId } from "../../../api/features/ModelRoles/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* What a project changed about one capability. Every field is optional and empty by default: an
|
|
5
|
+
* untouched capability runs on its declared role with its declared prompt.
|
|
6
|
+
*/
|
|
7
|
+
export interface AiCapabilityOverride {
|
|
8
|
+
/** Run this capability on a different role. Empty means use the capability's default. */
|
|
9
|
+
roleId?: AiModelRoleId | "";
|
|
10
|
+
/** Pin an exact connection, bypassing roles entirely. Requires `model` too. */
|
|
11
|
+
connectionId?: string;
|
|
12
|
+
/** Pin an exact model. Only read when `connectionId` is also set. */
|
|
13
|
+
model?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Appended to the capability's prompt.
|
|
16
|
+
*
|
|
17
|
+
* The only prompt customisation there is, and deliberately so. Replacing a prompt outright
|
|
18
|
+
* used to be offered here and is not any more: for most capabilities the prompt *is* the output
|
|
19
|
+
* contract the surrounding code parses, so replacing it means replacing part of the
|
|
20
|
+
* implementation. Revision comparison regex-matches the HTML table its prompt specifies, and
|
|
21
|
+
* page translation `JSON.parse`s a shape its prompt dictates, both failing silently if the
|
|
22
|
+
* format goes away. Appending leaves the contract in place.
|
|
23
|
+
*
|
|
24
|
+
* A project that genuinely needs different behaviour decorates the use case in code, which is
|
|
25
|
+
* how the AI translation itself is built.
|
|
26
|
+
*/
|
|
27
|
+
additionalInstructions?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Everything a project decided about one capability.
|
|
31
|
+
*
|
|
32
|
+
* Two separate concerns, deliberately not flattened into one bag of optional fields. `enabled` is a
|
|
33
|
+
* boolean and the rest are strings, and an emptiness check that has to judge both at once is how
|
|
34
|
+
* "the user switched this off" ends up indistinguishable from "the user typed nothing".
|
|
35
|
+
*/
|
|
36
|
+
export interface AiCapabilityEntry {
|
|
37
|
+
/**
|
|
38
|
+
* Absent means enabled.
|
|
39
|
+
*
|
|
40
|
+
* A licence that grants a capability turns it on immediately; nobody opens settings to opt in.
|
|
41
|
+
* A save writes this explicitly either way, so a stored blob says plainly what the screen said,
|
|
42
|
+
* but absence still has to read as enabled: a capability registered since the last save has no
|
|
43
|
+
* entry at all.
|
|
44
|
+
*
|
|
45
|
+
* Read it as `enabled !== false`, never as `!enabled`. The second is true for `undefined` too,
|
|
46
|
+
* which silently disables every capability nobody has saved yet.
|
|
47
|
+
*/
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
overrides: AiCapabilityOverride;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Keyed by capability id.
|
|
53
|
+
*
|
|
54
|
+
* Unlike model roles this cannot be a union of known keys: features register capabilities at
|
|
55
|
+
* runtime and an extension can add its own, so there is no compile-time set to enumerate.
|
|
56
|
+
*
|
|
57
|
+
* `Partial` is doing real work though. A bare `Record<string, T>` claims every string key is
|
|
58
|
+
* present, so a lookup types as `T` and the `?? {}` every caller writes looks redundant to the
|
|
59
|
+
* compiler. Most capabilities are untouched, so a miss is the common case.
|
|
60
|
+
*/
|
|
61
|
+
export type AiCapabilityEntries = Partial<Record<string, AiCapabilityEntry>>;
|
|
62
|
+
declare module "~/api/types.js" {
|
|
63
|
+
interface IAiPowerUpsSettings {
|
|
64
|
+
capabilities: {
|
|
65
|
+
items: AiCapabilityEntries;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export type CapabilitiesSettings = IAiPowerUpsSettings["capabilities"];
|
|
70
|
+
/**
|
|
71
|
+
* What `mapToStorage` writes, where `enabled` is required.
|
|
72
|
+
*
|
|
73
|
+
* Reading has to tolerate its absence, because an entry saved before this flag existed, or a
|
|
74
|
+
* capability registered since the last save, has no value for it. Writing never does: every entry
|
|
75
|
+
* the form posts is settled to a real boolean. Saying so here is what makes the compiler check the
|
|
76
|
+
* one place that writes the flag this feature is about.
|
|
77
|
+
*/
|
|
78
|
+
export interface PersistedAiCapabilityEntry {
|
|
79
|
+
enabled: boolean;
|
|
80
|
+
overrides: AiCapabilityOverride;
|
|
81
|
+
}
|
|
82
|
+
export interface PersistedCapabilities {
|
|
83
|
+
items?: Partial<Record<string, PersistedAiCapabilityEntry>>;
|
|
84
|
+
}
|
|
85
|
+
/** Absent means enabled. Spelled out once so no call site has to get the comparison right. */
|
|
86
|
+
export declare const isCapabilityEnabled: (entry: AiCapabilityEntry | undefined) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/Capabilities/types.js","sources":["../../../../src/api/features/Capabilities/types.ts"],"sourcesContent":["import type { IAiPowerUpsSettings } from \"~/api/types.js\";\nimport type { AiModelRoleId } from \"~/api/features/ModelRoles/index.js\";\n\n/**\n * What a project changed about one capability. Every field is optional and empty by default: an\n * untouched capability runs on its declared role with its declared prompt.\n */\nexport interface AiCapabilityOverride {\n /** Run this capability on a different role. Empty means use the capability's default. */\n roleId?: AiModelRoleId | \"\";\n /** Pin an exact connection, bypassing roles entirely. Requires `model` too. */\n connectionId?: string;\n /** Pin an exact model. Only read when `connectionId` is also set. */\n model?: string;\n /**\n * Appended to the capability's prompt.\n *\n * The only prompt customisation there is, and deliberately so. Replacing a prompt outright\n * used to be offered here and is not any more: for most capabilities the prompt *is* the output\n * contract the surrounding code parses, so replacing it means replacing part of the\n * implementation. Revision comparison regex-matches the HTML table its prompt specifies, and\n * page translation `JSON.parse`s a shape its prompt dictates, both failing silently if the\n * format goes away. Appending leaves the contract in place.\n *\n * A project that genuinely needs different behaviour decorates the use case in code, which is\n * how the AI translation itself is built.\n */\n additionalInstructions?: string;\n}\n\n/**\n * Everything a project decided about one capability.\n *\n * Two separate concerns, deliberately not flattened into one bag of optional fields. `enabled` is a\n * boolean and the rest are strings, and an emptiness check that has to judge both at once is how\n * \"the user switched this off\" ends up indistinguishable from \"the user typed nothing\".\n */\nexport interface AiCapabilityEntry {\n /**\n * Absent means enabled.\n *\n * A licence that grants a capability turns it on immediately; nobody opens settings to opt in.\n * A save writes this explicitly either way, so a stored blob says plainly what the screen said,\n * but absence still has to read as enabled: a capability registered since the last save has no\n * entry at all.\n *\n * Read it as `enabled !== false`, never as `!enabled`. The second is true for `undefined` too,\n * which silently disables every capability nobody has saved yet.\n */\n enabled?: boolean;\n overrides: AiCapabilityOverride;\n}\n\n/**\n * Keyed by capability id.\n *\n * Unlike model roles this cannot be a union of known keys: features register capabilities at\n * runtime and an extension can add its own, so there is no compile-time set to enumerate.\n *\n * `Partial` is doing real work though. A bare `Record<string, T>` claims every string key is\n * present, so a lookup types as `T` and the `?? {}` every caller writes looks redundant to the\n * compiler. Most capabilities are untouched, so a miss is the common case.\n */\nexport type AiCapabilityEntries = Partial<Record<string, AiCapabilityEntry>>;\n\ndeclare module \"~/api/types.js\" {\n interface IAiPowerUpsSettings {\n capabilities: {\n items: AiCapabilityEntries;\n };\n }\n}\n\nexport type CapabilitiesSettings = IAiPowerUpsSettings[\"capabilities\"];\n\n/**\n * What `mapToStorage` writes, where `enabled` is required.\n *\n * Reading has to tolerate its absence, because an entry saved before this flag existed, or a\n * capability registered since the last save, has no value for it. Writing never does: every entry\n * the form posts is settled to a real boolean. Saying so here is what makes the compiler check the\n * one place that writes the flag this feature is about.\n */\nexport interface PersistedAiCapabilityEntry {\n enabled: boolean;\n overrides: AiCapabilityOverride;\n}\n\nexport interface PersistedCapabilities {\n items?: Partial<Record<string, PersistedAiCapabilityEntry>>;\n}\n\n/** Absent means enabled. Spelled out once so no call site has to get the comparison right. */\nexport const isCapabilityEnabled = (entry: AiCapabilityEntry | undefined): boolean =>\n entry?.enabled !== false;\n"],"names":["isCapabilityEnabled","entry"],"mappings":"AA6FO,MAAMA,sBAAsB,CAACC,QAChCA,OAAO,YAAY"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ai } from "@webiny/api-core/features/ai/index.js";
|
|
2
|
+
import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
|
|
3
|
+
import { ModelToAstConverter } from "@webiny/api-headless-cms/features/contentModel/ModelToAstConverter/index.js";
|
|
4
|
+
import { GetRevisionByIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetRevisionById/index.js";
|
|
5
|
+
import { ResolveAiCapabilityUseCase } from "../../../api/features/Capabilities/index.js";
|
|
6
|
+
import { CmsCompareEntryRevisionsUseCase } from "./abstractions.js";
|
|
7
|
+
import type { ICmsCompareEntryRevisionsParams, ICmsCompareEntryRevisionsResult } from "./abstractions.js";
|
|
8
|
+
declare class CmsCompareEntryRevisionsUseCaseImpl implements CmsCompareEntryRevisionsUseCase.Interface {
|
|
9
|
+
private resolveCapability;
|
|
10
|
+
private ai;
|
|
11
|
+
private getModel;
|
|
12
|
+
private getRevisionById;
|
|
13
|
+
private modelToAst;
|
|
14
|
+
constructor(resolveCapability: ResolveAiCapabilityUseCase.Interface, ai: Ai.Interface, getModel: GetModelUseCase.Interface, getRevisionById: GetRevisionByIdUseCase.Interface, modelToAst: ModelToAstConverter.Interface);
|
|
15
|
+
execute(params: ICmsCompareEntryRevisionsParams): Promise<ICmsCompareEntryRevisionsResult>;
|
|
16
|
+
}
|
|
17
|
+
export declare const CmsCompareEntryRevisionsUseCaseImplementation: typeof CmsCompareEntryRevisionsUseCaseImpl & {
|
|
18
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICmsCompareEntryRevisionsUseCase>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Ai } from "@webiny/api-core/features/ai/index.js";
|
|
2
|
+
import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
|
|
3
|
+
import { ModelToAstConverter } from "@webiny/api-headless-cms/features/contentModel/ModelToAstConverter/index.js";
|
|
4
|
+
import { CmsModelToJsonSchemaConverter } from "@webiny/api-headless-cms/utils/contentModelToJsonSchema/index.js";
|
|
5
|
+
import { GetRevisionByIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetRevisionById/index.js";
|
|
6
|
+
import { ResolveAiCapabilityUseCase, withAdditionalInstructions } from "../Capabilities/index.js";
|
|
7
|
+
import { CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY } from "./capability.js";
|
|
8
|
+
import { CmsCompareEntryRevisionsUseCase } from "./abstractions.js";
|
|
9
|
+
class CmsCompareEntryRevisionsUseCaseImpl {
|
|
10
|
+
constructor(resolveCapability, ai, getModel, getRevisionById, modelToAst){
|
|
11
|
+
this.resolveCapability = resolveCapability;
|
|
12
|
+
this.ai = ai;
|
|
13
|
+
this.getModel = getModel;
|
|
14
|
+
this.getRevisionById = getRevisionById;
|
|
15
|
+
this.modelToAst = modelToAst;
|
|
16
|
+
}
|
|
17
|
+
async execute(params) {
|
|
18
|
+
const { modelId, revisionId1, revisionId2 } = params;
|
|
19
|
+
const resolved = await this.resolveCapability.execute(CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY);
|
|
20
|
+
if (resolved.isFail()) throw resolved.error;
|
|
21
|
+
const capability = resolved.value;
|
|
22
|
+
const modelResult = await this.getModel.execute(modelId);
|
|
23
|
+
if (modelResult.isFail()) throw new Error(`Content model "${modelId}" not found.`);
|
|
24
|
+
const model = modelResult.value;
|
|
25
|
+
const [rev1Result, rev2Result] = await Promise.all([
|
|
26
|
+
this.getRevisionById.execute(model, revisionId1),
|
|
27
|
+
this.getRevisionById.execute(model, revisionId2)
|
|
28
|
+
]);
|
|
29
|
+
if (rev1Result.isFail()) throw new Error(`Revision "${revisionId1}" not found.`);
|
|
30
|
+
if (rev2Result.isFail()) throw new Error(`Revision "${revisionId2}" not found.`);
|
|
31
|
+
const revision1 = rev1Result.value;
|
|
32
|
+
const revision2 = rev2Result.value;
|
|
33
|
+
const modelAst = this.modelToAst.toAst(model);
|
|
34
|
+
const jsonSchemaConverter = new CmsModelToJsonSchemaConverter();
|
|
35
|
+
const entrySchema = jsonSchemaConverter.convert(modelAst, {
|
|
36
|
+
name: model.name,
|
|
37
|
+
description: model.description
|
|
38
|
+
});
|
|
39
|
+
const userPrompt = `CONTENT MODEL JSON SCHEMA:
|
|
40
|
+
${JSON.stringify(entrySchema, null, 2)}
|
|
41
|
+
|
|
42
|
+
VERSION A (Revision #${revision1.version}):
|
|
43
|
+
${JSON.stringify(revision1.values, null, 2)}
|
|
44
|
+
|
|
45
|
+
VERSION B (Revision #${revision2.version}):
|
|
46
|
+
${JSON.stringify(revision2.values, null, 2)}`;
|
|
47
|
+
const result = await this.ai.generateText({
|
|
48
|
+
model: capability.model,
|
|
49
|
+
connection: capability.connection,
|
|
50
|
+
system: withAdditionalInstructions(capability),
|
|
51
|
+
prompt: userPrompt,
|
|
52
|
+
temperature: 0.3
|
|
53
|
+
});
|
|
54
|
+
const text = result.text;
|
|
55
|
+
const noChangesMatch = text.match(/No differences detected/);
|
|
56
|
+
let summary = "Content comparison completed";
|
|
57
|
+
if (noChangesMatch) summary = "No differences detected between versions";
|
|
58
|
+
else {
|
|
59
|
+
const headingMatch = text.match(/<h[2-3][^>]*>([^<]+)<\/h[2-3]>/);
|
|
60
|
+
const trCount = (text.match(/<tr>/g) || []).length - 1;
|
|
61
|
+
if (headingMatch) summary = headingMatch[1].trim();
|
|
62
|
+
else if (trCount > 0) summary = `${trCount} field${1 === trCount ? "" : "s"} changed`;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
html: text,
|
|
66
|
+
summary
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const CmsCompareEntryRevisionsUseCaseImplementation = CmsCompareEntryRevisionsUseCase.createImplementation({
|
|
71
|
+
implementation: CmsCompareEntryRevisionsUseCaseImpl,
|
|
72
|
+
dependencies: [
|
|
73
|
+
ResolveAiCapabilityUseCase,
|
|
74
|
+
Ai,
|
|
75
|
+
GetModelUseCase,
|
|
76
|
+
GetRevisionByIdUseCase,
|
|
77
|
+
ModelToAstConverter
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
export { CmsCompareEntryRevisionsUseCaseImplementation };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=CmsCompareEntryRevisionsUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.js","sources":["../../../../src/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.ts"],"sourcesContent":["import { Ai } from \"@webiny/api-core/features/ai/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { ModelToAstConverter } from \"@webiny/api-headless-cms/features/contentModel/ModelToAstConverter/index.js\";\nimport { CmsModelToJsonSchemaConverter } from \"@webiny/api-headless-cms/utils/contentModelToJsonSchema/index.js\";\nimport { GetRevisionByIdUseCase } from \"@webiny/api-headless-cms/features/contentEntry/GetRevisionById/index.js\";\nimport {\n ResolveAiCapabilityUseCase,\n withAdditionalInstructions\n} from \"~/api/features/Capabilities/index.js\";\nimport { CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY } from \"./capability.js\";\nimport { CmsCompareEntryRevisionsUseCase } from \"./abstractions.js\";\nimport type {\n ICmsCompareEntryRevisionsParams,\n ICmsCompareEntryRevisionsResult\n} from \"./abstractions.js\";\n\nclass CmsCompareEntryRevisionsUseCaseImpl implements CmsCompareEntryRevisionsUseCase.Interface {\n constructor(\n private resolveCapability: ResolveAiCapabilityUseCase.Interface,\n private ai: Ai.Interface,\n private getModel: GetModelUseCase.Interface,\n private getRevisionById: GetRevisionByIdUseCase.Interface,\n private modelToAst: ModelToAstConverter.Interface\n ) {}\n\n async execute(\n params: ICmsCompareEntryRevisionsParams\n ): Promise<ICmsCompareEntryRevisionsResult> {\n const { modelId, revisionId1, revisionId2 } = params;\n\n const resolved = await this.resolveCapability.execute(\n CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY\n );\n if (resolved.isFail()) {\n throw resolved.error;\n }\n\n const capability = resolved.value;\n\n const modelResult = await this.getModel.execute(modelId);\n if (modelResult.isFail()) {\n throw new Error(`Content model \"${modelId}\" not found.`);\n }\n const model = modelResult.value;\n\n const [rev1Result, rev2Result] = await Promise.all([\n this.getRevisionById.execute(model, revisionId1),\n this.getRevisionById.execute(model, revisionId2)\n ]);\n\n if (rev1Result.isFail()) {\n throw new Error(`Revision \"${revisionId1}\" not found.`);\n }\n if (rev2Result.isFail()) {\n throw new Error(`Revision \"${revisionId2}\" not found.`);\n }\n\n const revision1 = rev1Result.value;\n const revision2 = rev2Result.value;\n\n const modelAst = this.modelToAst.toAst(model);\n const jsonSchemaConverter = new CmsModelToJsonSchemaConverter();\n const entrySchema = jsonSchemaConverter.convert(modelAst, {\n name: model.name,\n description: model.description\n });\n\n const userPrompt = `CONTENT MODEL JSON SCHEMA:\n${JSON.stringify(entrySchema, null, 2)}\n\nVERSION A (Revision #${revision1.version}):\n${JSON.stringify(revision1.values, null, 2)}\n\nVERSION B (Revision #${revision2.version}):\n${JSON.stringify(revision2.values, null, 2)}`;\n\n const result = await this.ai.generateText({\n model: capability.model,\n connection: capability.connection,\n system: withAdditionalInstructions(capability),\n prompt: userPrompt,\n temperature: 0.3\n });\n\n const text = result.text;\n\n const noChangesMatch = text.match(/No differences detected/);\n let summary = \"Content comparison completed\";\n if (noChangesMatch) {\n summary = \"No differences detected between versions\";\n } else {\n const headingMatch = text.match(/<h[2-3][^>]*>([^<]+)<\\/h[2-3]>/);\n const trCount = (text.match(/<tr>/g) || []).length - 1;\n if (headingMatch) {\n summary = headingMatch[1].trim();\n } else if (trCount > 0) {\n summary = `${trCount} field${trCount === 1 ? \"\" : \"s\"} changed`;\n }\n }\n\n return { html: text, summary };\n }\n}\n\nexport const CmsCompareEntryRevisionsUseCaseImplementation =\n CmsCompareEntryRevisionsUseCase.createImplementation({\n implementation: CmsCompareEntryRevisionsUseCaseImpl,\n dependencies: [\n ResolveAiCapabilityUseCase,\n Ai,\n GetModelUseCase,\n GetRevisionByIdUseCase,\n ModelToAstConverter\n ]\n });\n"],"names":["CmsCompareEntryRevisionsUseCaseImpl","resolveCapability","ai","getModel","getRevisionById","modelToAst","params","modelId","revisionId1","revisionId2","resolved","CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY","capability","modelResult","Error","model","rev1Result","rev2Result","Promise","revision1","revision2","modelAst","jsonSchemaConverter","CmsModelToJsonSchemaConverter","entrySchema","userPrompt","JSON","result","withAdditionalInstructions","text","noChangesMatch","summary","headingMatch","trCount","CmsCompareEntryRevisionsUseCaseImplementation","CmsCompareEntryRevisionsUseCase","ResolveAiCapabilityUseCase","Ai","GetModelUseCase","GetRevisionByIdUseCase","ModelToAstConverter"],"mappings":";;;;;;;;AAgBA,MAAMA;IACF,YACYC,iBAAuD,EACvDC,EAAgB,EAChBC,QAAmC,EACnCC,eAAiD,EACjDC,UAAyC,CACnD;aALUJ,iBAAiB,GAAjBA;aACAC,EAAE,GAAFA;aACAC,QAAQ,GAARA;aACAC,eAAe,GAAfA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QACFC,MAAuC,EACC;QACxC,MAAM,EAAEC,OAAO,EAAEC,WAAW,EAAEC,WAAW,EAAE,GAAGH;QAE9C,MAAMI,WAAW,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CACjDC;QAEJ,IAAID,SAAS,MAAM,IACf,MAAMA,SAAS,KAAK;QAGxB,MAAME,aAAaF,SAAS,KAAK;QAEjC,MAAMG,cAAc,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAACN;QAChD,IAAIM,YAAY,MAAM,IAClB,MAAM,IAAIC,MAAM,CAAC,eAAe,EAAEP,QAAQ,YAAY,CAAC;QAE3D,MAAMQ,QAAQF,YAAY,KAAK;QAE/B,MAAM,CAACG,YAAYC,WAAW,GAAG,MAAMC,QAAQ,GAAG,CAAC;YAC/C,IAAI,CAAC,eAAe,CAAC,OAAO,CAACH,OAAOP;YACpC,IAAI,CAAC,eAAe,CAAC,OAAO,CAACO,OAAON;SACvC;QAED,IAAIO,WAAW,MAAM,IACjB,MAAM,IAAIF,MAAM,CAAC,UAAU,EAAEN,YAAY,YAAY,CAAC;QAE1D,IAAIS,WAAW,MAAM,IACjB,MAAM,IAAIH,MAAM,CAAC,UAAU,EAAEL,YAAY,YAAY,CAAC;QAG1D,MAAMU,YAAYH,WAAW,KAAK;QAClC,MAAMI,YAAYH,WAAW,KAAK;QAElC,MAAMI,WAAW,IAAI,CAAC,UAAU,CAAC,KAAK,CAACN;QACvC,MAAMO,sBAAsB,IAAIC;QAChC,MAAMC,cAAcF,oBAAoB,OAAO,CAACD,UAAU;YACtD,MAAMN,MAAM,IAAI;YAChB,aAAaA,MAAM,WAAW;QAClC;QAEA,MAAMU,aAAa,CAAC;AAC5B,EAAEC,KAAK,SAAS,CAACF,aAAa,MAAM,GAAG;;qBAElB,EAAEL,UAAU,OAAO,CAAC;AACzC,EAAEO,KAAK,SAAS,CAACP,UAAU,MAAM,EAAE,MAAM,GAAG;;qBAEvB,EAAEC,UAAU,OAAO,CAAC;AACzC,EAAEM,KAAK,SAAS,CAACN,UAAU,MAAM,EAAE,MAAM,IAAI;QAErC,MAAMO,SAAS,MAAM,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC;YACtC,OAAOf,WAAW,KAAK;YACvB,YAAYA,WAAW,UAAU;YACjC,QAAQgB,2BAA2BhB;YACnC,QAAQa;YACR,aAAa;QACjB;QAEA,MAAMI,OAAOF,OAAO,IAAI;QAExB,MAAMG,iBAAiBD,KAAK,KAAK,CAAC;QAClC,IAAIE,UAAU;QACd,IAAID,gBACAC,UAAU;aACP;YACH,MAAMC,eAAeH,KAAK,KAAK,CAAC;YAChC,MAAMI,UAAWJ,AAAAA,CAAAA,KAAK,KAAK,CAAC,YAAY,EAAC,EAAG,MAAM,GAAG;YACrD,IAAIG,cACAD,UAAUC,YAAY,CAAC,EAAE,CAAC,IAAI;iBAC3B,IAAIC,UAAU,GACjBF,UAAU,GAAGE,QAAQ,MAAM,EAAEA,AAAY,MAAZA,UAAgB,KAAK,IAAI,QAAQ,CAAC;QAEvE;QAEA,OAAO;YAAE,MAAMJ;YAAME;QAAQ;IACjC;AACJ;AAEO,MAAMG,gDACTC,gCAAgC,oBAAoB,CAAC;IACjD,gBAAgBnC;IAChB,cAAc;QACVoC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ICmsCompareEntryRevisionsResult {
|
|
2
|
+
html: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ICmsCompareEntryRevisionsParams {
|
|
6
|
+
modelId: string;
|
|
7
|
+
revisionId1: string;
|
|
8
|
+
revisionId2: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ICmsCompareEntryRevisionsUseCase {
|
|
11
|
+
execute(params: ICmsCompareEntryRevisionsParams): Promise<ICmsCompareEntryRevisionsResult>;
|
|
12
|
+
}
|
|
13
|
+
export declare const CmsCompareEntryRevisionsUseCase: import("@webiny/di").Abstraction<ICmsCompareEntryRevisionsUseCase>;
|
|
14
|
+
export declare namespace CmsCompareEntryRevisionsUseCase {
|
|
15
|
+
type Interface = ICmsCompareEntryRevisionsUseCase;
|
|
16
|
+
type Params = ICmsCompareEntryRevisionsParams;
|
|
17
|
+
type Result = ICmsCompareEntryRevisionsResult;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/CmsCompareEntryRevisions/abstractions.js","sources":["../../../../src/api/features/CmsCompareEntryRevisions/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\n\nexport interface ICmsCompareEntryRevisionsResult {\n html: string;\n summary: string;\n}\n\nexport interface ICmsCompareEntryRevisionsParams {\n modelId: string;\n revisionId1: string;\n revisionId2: string;\n}\n\nexport interface ICmsCompareEntryRevisionsUseCase {\n execute(params: ICmsCompareEntryRevisionsParams): Promise<ICmsCompareEntryRevisionsResult>;\n}\n\nexport const CmsCompareEntryRevisionsUseCase = createAbstraction<ICmsCompareEntryRevisionsUseCase>(\n \"AiPowerUpsCmsCompareEntryRevisionsUseCase\"\n);\n\nexport namespace CmsCompareEntryRevisionsUseCase {\n export type Interface = ICmsCompareEntryRevisionsUseCase;\n export type Params = ICmsCompareEntryRevisionsParams;\n export type Result = ICmsCompareEntryRevisionsResult;\n}\n"],"names":["CmsCompareEntryRevisionsUseCase","createAbstraction"],"mappings":";AAiBO,MAAMA,kCAAkCC,kBAC3C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AiCapability } from "../../../api/features/Capabilities/index.js";
|
|
2
|
+
export declare const CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY = "cmsCompareEntryRevisions";
|
|
3
|
+
declare class CmsCompareEntryRevisionsCapabilityImpl implements AiCapability.Interface {
|
|
4
|
+
readonly id = "cmsCompareEntryRevisions";
|
|
5
|
+
readonly label = "CMS revision comparison";
|
|
6
|
+
readonly description = "Summarises what changed between two revisions of an entry. Short, structural work that a smaller model handles well.";
|
|
7
|
+
readonly defaultRole: "fast";
|
|
8
|
+
readonly guidance = "You are a content intelligence assistant specialized in version comparison for headless CMS platforms.\n\nI will provide:\n\n1. The content model JSON Schema that defines the structure of the entry.\n2. Two versions of the content entry values in JSON format: Version A and Version B.\n\nYour task:\n\n- Parse both versions according to the JSON Schema.\n- Identify all differences between Version A and Version B.\n- For each difference, explain:\n - The field name (use the human-readable label from the schema description if available)\n - The value in Version A\n - The value in Version B\n - A brief summary of the change (e.g., \"Title changed from 'Old' to 'New'\")\n- If nested fields or objects exist, perform a deep comparison.\n- Return the comparison in clean HTML format.\n\nOutput format:\n\n<div class=\"comparison-report\">\n <table class=\"comparison-table\">\n <thead>\n <tr>\n <th>Field</th>\n <th>Version A</th>\n <th>Version B</th>\n <th>Change Summary</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong>title</strong></td>\n <td>Launch Plan</td>\n <td>Updated Launch Plan</td>\n <td>Title changed from 'Launch Plan' to 'Updated Launch Plan'</td>\n </tr>\n </tbody>\n </table>\n</div>\n\nIf no differences are found, return: <div class=\"no-changes\"><h3>No differences detected between Version A and Version B.</h3></div>\n\nUse semantic HTML with appropriate CSS classes for styling. Do not include <style> tags or CSS \u2014 only return the HTML structure.\nFor rich text or complex nested values, show a concise summary rather than raw JSON.";
|
|
9
|
+
}
|
|
10
|
+
export declare const CmsCompareEntryRevisionsCapability: typeof CmsCompareEntryRevisionsCapabilityImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/api/features/Capabilities/index.js").IAiCapability>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { AiCapability } from "../Capabilities/index.js";
|
|
2
|
+
const CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY = "cmsCompareEntryRevisions";
|
|
3
|
+
const guidance = `You are a content intelligence assistant specialized in version comparison for headless CMS platforms.
|
|
4
|
+
|
|
5
|
+
I will provide:
|
|
6
|
+
|
|
7
|
+
1. The content model JSON Schema that defines the structure of the entry.
|
|
8
|
+
2. Two versions of the content entry values in JSON format: Version A and Version B.
|
|
9
|
+
|
|
10
|
+
Your task:
|
|
11
|
+
|
|
12
|
+
- Parse both versions according to the JSON Schema.
|
|
13
|
+
- Identify all differences between Version A and Version B.
|
|
14
|
+
- For each difference, explain:
|
|
15
|
+
- The field name (use the human-readable label from the schema description if available)
|
|
16
|
+
- The value in Version A
|
|
17
|
+
- The value in Version B
|
|
18
|
+
- A brief summary of the change (e.g., "Title changed from 'Old' to 'New'")
|
|
19
|
+
- If nested fields or objects exist, perform a deep comparison.
|
|
20
|
+
- Return the comparison in clean HTML format.
|
|
21
|
+
|
|
22
|
+
Output format:
|
|
23
|
+
|
|
24
|
+
<div class="comparison-report">
|
|
25
|
+
<table class="comparison-table">
|
|
26
|
+
<thead>
|
|
27
|
+
<tr>
|
|
28
|
+
<th>Field</th>
|
|
29
|
+
<th>Version A</th>
|
|
30
|
+
<th>Version B</th>
|
|
31
|
+
<th>Change Summary</th>
|
|
32
|
+
</tr>
|
|
33
|
+
</thead>
|
|
34
|
+
<tbody>
|
|
35
|
+
<tr>
|
|
36
|
+
<td><strong>title</strong></td>
|
|
37
|
+
<td>Launch Plan</td>
|
|
38
|
+
<td>Updated Launch Plan</td>
|
|
39
|
+
<td>Title changed from 'Launch Plan' to 'Updated Launch Plan'</td>
|
|
40
|
+
</tr>
|
|
41
|
+
</tbody>
|
|
42
|
+
</table>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
If no differences are found, return: <div class="no-changes"><h3>No differences detected between Version A and Version B.</h3></div>
|
|
46
|
+
|
|
47
|
+
Use semantic HTML with appropriate CSS classes for styling. Do not include <style> tags or CSS — only return the HTML structure.
|
|
48
|
+
For rich text or complex nested values, show a concise summary rather than raw JSON.`;
|
|
49
|
+
class CmsCompareEntryRevisionsCapabilityImpl {
|
|
50
|
+
constructor(){
|
|
51
|
+
this.id = CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY;
|
|
52
|
+
this.label = "CMS revision comparison";
|
|
53
|
+
this.description = "Summarises what changed between two revisions of an entry. Short, structural work that a smaller model handles well.";
|
|
54
|
+
this.defaultRole = "fast";
|
|
55
|
+
this.guidance = guidance;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const CmsCompareEntryRevisionsCapability = AiCapability.createImplementation({
|
|
59
|
+
implementation: CmsCompareEntryRevisionsCapabilityImpl,
|
|
60
|
+
dependencies: []
|
|
61
|
+
});
|
|
62
|
+
export { CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY, CmsCompareEntryRevisionsCapability };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=capability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/CmsCompareEntryRevisions/capability.js","sources":["../../../../src/api/features/CmsCompareEntryRevisions/capability.ts"],"sourcesContent":["import { AiCapability } from \"~/api/features/Capabilities/index.js\";\n\nexport const CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY = \"cmsCompareEntryRevisions\";\n\n/**\n * The output contract lives in this prompt: the use case regex-matches the HTML table it specifies\n * to build the summary, down to the literal \"No differences detected\" sentence and a count of\n * `<tr>` tags, and the dialog styles those classes. That is why a project can only append to it.\n */\nconst guidance = `You are a content intelligence assistant specialized in version comparison for headless CMS platforms.\n\nI will provide:\n\n1. The content model JSON Schema that defines the structure of the entry.\n2. Two versions of the content entry values in JSON format: Version A and Version B.\n\nYour task:\n\n- Parse both versions according to the JSON Schema.\n- Identify all differences between Version A and Version B.\n- For each difference, explain:\n - The field name (use the human-readable label from the schema description if available)\n - The value in Version A\n - The value in Version B\n - A brief summary of the change (e.g., \"Title changed from 'Old' to 'New'\")\n- If nested fields or objects exist, perform a deep comparison.\n- Return the comparison in clean HTML format.\n\nOutput format:\n\n<div class=\"comparison-report\">\n <table class=\"comparison-table\">\n <thead>\n <tr>\n <th>Field</th>\n <th>Version A</th>\n <th>Version B</th>\n <th>Change Summary</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong>title</strong></td>\n <td>Launch Plan</td>\n <td>Updated Launch Plan</td>\n <td>Title changed from 'Launch Plan' to 'Updated Launch Plan'</td>\n </tr>\n </tbody>\n </table>\n</div>\n\nIf no differences are found, return: <div class=\"no-changes\"><h3>No differences detected between Version A and Version B.</h3></div>\n\nUse semantic HTML with appropriate CSS classes for styling. Do not include <style> tags or CSS — only return the HTML structure.\nFor rich text or complex nested values, show a concise summary rather than raw JSON.`;\n\nclass CmsCompareEntryRevisionsCapabilityImpl implements AiCapability.Interface {\n readonly id = CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY;\n readonly label = \"CMS revision comparison\";\n readonly description =\n \"Summarises what changed between two revisions of an entry. Short, structural work that a smaller model handles well.\";\n readonly defaultRole = \"fast\" as const;\n readonly guidance = guidance;\n}\n\nexport const CmsCompareEntryRevisionsCapability = AiCapability.createImplementation({\n implementation: CmsCompareEntryRevisionsCapabilityImpl,\n dependencies: []\n});\n"],"names":["CMS_COMPARE_ENTRY_REVISIONS_CAPABILITY","guidance","CmsCompareEntryRevisionsCapabilityImpl","CmsCompareEntryRevisionsCapability","AiCapability"],"mappings":";AAEO,MAAMA,yCAAyC;AAOtD,MAAMC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oFA6CkE,CAAC;AAErF,MAAMC;;aACO,EAAE,GAAGF;aACL,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAG;aACd,QAAQ,GAAGC;;AACxB;AAEO,MAAME,qCAAqCC,aAAa,oBAAoB,CAAC;IAChF,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { CmsCompareEntryRevisionsUseCaseImplementation } from "./CmsCompareEntryRevisionsUseCase.js";
|
|
3
|
+
import { CmsCompareEntryRevisionsCapability } from "./capability.js";
|
|
4
|
+
const CmsCompareEntryRevisionsFeature = createFeature({
|
|
5
|
+
name: "AiPowerUps/CmsCompareEntryRevisions",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(CmsCompareEntryRevisionsCapability);
|
|
8
|
+
container.register(CmsCompareEntryRevisionsUseCaseImplementation);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export { CmsCompareEntryRevisionsFeature };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/CmsCompareEntryRevisions/feature.js","sources":["../../../../src/api/features/CmsCompareEntryRevisions/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CmsCompareEntryRevisionsUseCaseImplementation } from \"./CmsCompareEntryRevisionsUseCase.js\";\nimport { CmsCompareEntryRevisionsCapability } from \"./capability.js\";\n\nexport const CmsCompareEntryRevisionsFeature = createFeature({\n name: \"AiPowerUps/CmsCompareEntryRevisions\",\n register(container) {\n container.register(CmsCompareEntryRevisionsCapability);\n container.register(CmsCompareEntryRevisionsUseCaseImplementation);\n }\n});\n"],"names":["CmsCompareEntryRevisionsFeature","createFeature","container","CmsCompareEntryRevisionsCapability","CmsCompareEntryRevisionsUseCaseImplementation"],"mappings":";;;AAIO,MAAMA,kCAAkCC,cAAc;IACzD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;IACvB;AACJ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TaskDefinition, TaskHandler } from "@webiny/api-core/features/task/TaskDefinition/index.js";
|
|
2
|
+
import { WebsocketsSendToIdentityUseCase } from "@webiny/api-websockets/features/SendToIdentity/abstractions.js";
|
|
3
|
+
import { CmsGenerateEntryContentUseCase } from "../../../api/features/CmsGenerateEntryContent/index.js";
|
|
4
|
+
import { IdentityContext } from "@webiny/api-core/exports/api/security.js";
|
|
5
|
+
export declare const CMS_GENERATE_ENTRY_CONTENT_TASK_ID = "aiPowerUpsGenerateEntryContent";
|
|
6
|
+
export interface ICmsGenerateEntryContentTaskInput {
|
|
7
|
+
prompt: string;
|
|
8
|
+
modelId: string;
|
|
9
|
+
projectId?: string | null;
|
|
10
|
+
excludedFileIds?: string[] | null;
|
|
11
|
+
readerPersonaId?: string | null;
|
|
12
|
+
writerPersonaId?: string | null;
|
|
13
|
+
additionalFileIds?: string[] | null;
|
|
14
|
+
}
|
|
15
|
+
declare class CmsGenerateEntryContentTaskHandlerImpl implements TaskHandler.Interface<ICmsGenerateEntryContentTaskInput> {
|
|
16
|
+
private identityContext;
|
|
17
|
+
private generateEntryContent;
|
|
18
|
+
private sendToIdentity;
|
|
19
|
+
constructor(identityContext: IdentityContext.Interface, generateEntryContent: CmsGenerateEntryContentUseCase.Interface, sendToIdentity: WebsocketsSendToIdentityUseCase.Interface);
|
|
20
|
+
run({ input, controller }: TaskHandler.RunParams<ICmsGenerateEntryContentTaskInput>): Promise<TaskDefinition.Result<ICmsGenerateEntryContentTaskInput>>;
|
|
21
|
+
private sendContentToUser;
|
|
22
|
+
private sendErrorToUser;
|
|
23
|
+
}
|
|
24
|
+
declare class CmsGenerateEntryContentTaskImpl implements TaskDefinition.Interface {
|
|
25
|
+
id: string;
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
maxIterations: number;
|
|
29
|
+
isPrivate: boolean;
|
|
30
|
+
databaseLogs: boolean;
|
|
31
|
+
handler: typeof CmsGenerateEntryContentTaskHandlerImpl & {
|
|
32
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/task/TaskDefinition/abstractions").ITaskHandler<import("@webiny/api-core/features/task/TaskDefinition/abstractions").ITaskInput, import("@webiny/api-core/features/task/TaskDefinition/abstractions").ITaskOutput>>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare const CmsGenerateEntryContentTask: typeof CmsGenerateEntryContentTaskImpl & {
|
|
36
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/task/TaskDefinition/abstractions").ITaskDefinition<import("@webiny/api-core/features/task/TaskDefinition/abstractions").ITaskInput, import("@webiny/api-core/features/task/TaskDefinition/abstractions").ITaskOutput>>;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { TaskDefinition, TaskHandler } from "@webiny/api-core/features/task/TaskDefinition/index.js";
|
|
2
|
+
import { WebsocketsSendToIdentityUseCase } from "@webiny/api-websockets/features/SendToIdentity/abstractions.js";
|
|
3
|
+
import { compressJson } from "@webiny/utils/features/compression/legacy/gzip.js";
|
|
4
|
+
import { CmsGenerateEntryContentUseCase } from "./index.js";
|
|
5
|
+
import { IdentityContext } from "@webiny/api-core/exports/api/security.js";
|
|
6
|
+
const CMS_GENERATE_ENTRY_CONTENT_TASK_ID = "aiPowerUpsGenerateEntryContent";
|
|
7
|
+
class CmsGenerateEntryContentTaskHandlerImpl {
|
|
8
|
+
constructor(identityContext, generateEntryContent, sendToIdentity){
|
|
9
|
+
this.identityContext = identityContext;
|
|
10
|
+
this.generateEntryContent = generateEntryContent;
|
|
11
|
+
this.sendToIdentity = sendToIdentity;
|
|
12
|
+
}
|
|
13
|
+
async run({ input, controller }) {
|
|
14
|
+
if (controller.runtime.isAborted()) return controller.response.aborted();
|
|
15
|
+
const identity = this.identityContext.getIdentity();
|
|
16
|
+
let result;
|
|
17
|
+
try {
|
|
18
|
+
result = await this.generateEntryContent.execute({
|
|
19
|
+
prompt: input.prompt,
|
|
20
|
+
modelId: input.modelId,
|
|
21
|
+
projectId: input.projectId,
|
|
22
|
+
excludedFileIds: input.excludedFileIds,
|
|
23
|
+
readerPersonaId: input.readerPersonaId,
|
|
24
|
+
writerPersonaId: input.writerPersonaId,
|
|
25
|
+
additionalFileIds: input.additionalFileIds
|
|
26
|
+
});
|
|
27
|
+
} catch (err) {
|
|
28
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
29
|
+
await this.sendErrorToUser(identity.id, message);
|
|
30
|
+
return controller.response.error({
|
|
31
|
+
message
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (result.isFail()) {
|
|
35
|
+
await this.sendErrorToUser(identity.id, result.error.message);
|
|
36
|
+
return controller.response.error({
|
|
37
|
+
message: result.error.message
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const compressed = await compressJson(result.value.values);
|
|
41
|
+
const payload = compressed.toString("base64");
|
|
42
|
+
await this.sendContentToUser(identity.id, payload, result.value.telemetry);
|
|
43
|
+
return controller.response.done("Entry content generated successfully.");
|
|
44
|
+
}
|
|
45
|
+
async sendContentToUser(identityId, payload, telemetry) {
|
|
46
|
+
await this.sendToIdentity.execute({
|
|
47
|
+
id: identityId
|
|
48
|
+
}, {
|
|
49
|
+
action: "aiPowerUps.generateEntryContent.content",
|
|
50
|
+
data: {
|
|
51
|
+
compression: "gzip",
|
|
52
|
+
value: payload,
|
|
53
|
+
telemetry
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async sendErrorToUser(identityId, message) {
|
|
58
|
+
await this.sendToIdentity.execute({
|
|
59
|
+
id: identityId
|
|
60
|
+
}, {
|
|
61
|
+
action: "aiPowerUps.generateEntryContent.error",
|
|
62
|
+
data: {
|
|
63
|
+
message
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const CmsGenerateEntryContentTaskHandler = TaskHandler.createImplementation({
|
|
69
|
+
implementation: CmsGenerateEntryContentTaskHandlerImpl,
|
|
70
|
+
dependencies: [
|
|
71
|
+
IdentityContext,
|
|
72
|
+
CmsGenerateEntryContentUseCase,
|
|
73
|
+
WebsocketsSendToIdentityUseCase
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
class CmsGenerateEntryContentTaskImpl {
|
|
77
|
+
constructor(){
|
|
78
|
+
this.id = CMS_GENERATE_ENTRY_CONTENT_TASK_ID;
|
|
79
|
+
this.title = "AI Power-Ups - Generate Entry Content";
|
|
80
|
+
this.description = "Generates CMS entry content using AI based on a user prompt.";
|
|
81
|
+
this.maxIterations = 1;
|
|
82
|
+
this.isPrivate = true;
|
|
83
|
+
this.databaseLogs = false;
|
|
84
|
+
this.handler = CmsGenerateEntryContentTaskHandler;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const CmsGenerateEntryContentTask = TaskDefinition.createImplementation({
|
|
88
|
+
implementation: CmsGenerateEntryContentTaskImpl,
|
|
89
|
+
dependencies: []
|
|
90
|
+
});
|
|
91
|
+
export { CMS_GENERATE_ENTRY_CONTENT_TASK_ID, CmsGenerateEntryContentTask };
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=CmsGenerateEntryContentTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js","sources":["../../../../src/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.ts"],"sourcesContent":["import {\n TaskDefinition,\n TaskHandler\n} from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { WebsocketsSendToIdentityUseCase } from \"@webiny/api-websockets/features/SendToIdentity/abstractions.js\";\nimport { compressJson } from \"@webiny/utils/features/compression/legacy/gzip.js\";\nimport { CmsGenerateEntryContentUseCase } from \"~/api/features/CmsGenerateEntryContent/index.js\";\nimport type { GenerateEntryContentTelemetry } from \"~/api/features/CmsGenerateEntryContent/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/exports/api/security.js\";\n\nexport const CMS_GENERATE_ENTRY_CONTENT_TASK_ID = \"aiPowerUpsGenerateEntryContent\";\n\nexport interface ICmsGenerateEntryContentTaskInput {\n prompt: string;\n modelId: string;\n projectId?: string | null;\n excludedFileIds?: string[] | null;\n readerPersonaId?: string | null;\n writerPersonaId?: string | null;\n additionalFileIds?: string[] | null;\n}\n\nclass CmsGenerateEntryContentTaskHandlerImpl implements TaskHandler.Interface<ICmsGenerateEntryContentTaskInput> {\n constructor(\n private identityContext: IdentityContext.Interface,\n private generateEntryContent: CmsGenerateEntryContentUseCase.Interface,\n private sendToIdentity: WebsocketsSendToIdentityUseCase.Interface\n ) {}\n\n async run({\n input,\n controller\n }: TaskHandler.RunParams<ICmsGenerateEntryContentTaskInput>): Promise<\n TaskDefinition.Result<ICmsGenerateEntryContentTaskInput>\n > {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n }\n\n const identity = this.identityContext.getIdentity();\n\n let result;\n try {\n result = await this.generateEntryContent.execute({\n prompt: input.prompt,\n modelId: input.modelId,\n projectId: input.projectId,\n excludedFileIds: input.excludedFileIds,\n readerPersonaId: input.readerPersonaId,\n writerPersonaId: input.writerPersonaId,\n additionalFileIds: input.additionalFileIds\n });\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n await this.sendErrorToUser(identity.id, message);\n return controller.response.error({ message });\n }\n\n if (result.isFail()) {\n await this.sendErrorToUser(identity.id, result.error.message);\n\n return controller.response.error({\n message: result.error.message\n });\n }\n\n // Serialize at the transport edge: the use case returns structured values; the\n // websocket stream carries a gzip+base64 JSON string that the Admin app decodes.\n const compressed = await compressJson(result.value.values);\n const payload = compressed.toString(\"base64\");\n\n await this.sendContentToUser(identity.id, payload, result.value.telemetry);\n\n return controller.response.done(\"Entry content generated successfully.\");\n }\n\n private async sendContentToUser(\n identityId: string,\n payload: string,\n telemetry: GenerateEntryContentTelemetry\n ) {\n await this.sendToIdentity.execute(\n { id: identityId },\n {\n action: \"aiPowerUps.generateEntryContent.content\",\n data: {\n compression: \"gzip\",\n value: payload,\n telemetry\n }\n }\n );\n }\n\n private async sendErrorToUser(identityId: string, message: string) {\n await this.sendToIdentity.execute(\n { id: identityId },\n {\n action: \"aiPowerUps.generateEntryContent.error\",\n data: {\n message\n }\n }\n );\n }\n}\n\nconst CmsGenerateEntryContentTaskHandler = TaskHandler.createImplementation({\n implementation: CmsGenerateEntryContentTaskHandlerImpl,\n dependencies: [IdentityContext, CmsGenerateEntryContentUseCase, WebsocketsSendToIdentityUseCase]\n});\n\nclass CmsGenerateEntryContentTaskImpl implements TaskDefinition.Interface {\n id = CMS_GENERATE_ENTRY_CONTENT_TASK_ID;\n title = \"AI Power-Ups - Generate Entry Content\";\n description = \"Generates CMS entry content using AI based on a user prompt.\";\n maxIterations = 1;\n isPrivate = true;\n databaseLogs = false;\n\n handler = CmsGenerateEntryContentTaskHandler;\n}\n\nexport const CmsGenerateEntryContentTask = TaskDefinition.createImplementation({\n implementation: CmsGenerateEntryContentTaskImpl,\n dependencies: []\n});\n"],"names":["CMS_GENERATE_ENTRY_CONTENT_TASK_ID","CmsGenerateEntryContentTaskHandlerImpl","identityContext","generateEntryContent","sendToIdentity","input","controller","identity","result","err","message","Error","String","compressed","compressJson","payload","identityId","telemetry","CmsGenerateEntryContentTaskHandler","TaskHandler","IdentityContext","CmsGenerateEntryContentUseCase","WebsocketsSendToIdentityUseCase","CmsGenerateEntryContentTaskImpl","CmsGenerateEntryContentTask","TaskDefinition"],"mappings":";;;;;AAUO,MAAMA,qCAAqC;AAYlD,MAAMC;IACF,YACYC,eAA0C,EAC1CC,oBAA8D,EAC9DC,cAAyD,CACnE;aAHUF,eAAe,GAAfA;aACAC,oBAAoB,GAApBA;aACAC,cAAc,GAAdA;IACT;IAEH,MAAM,IAAI,EACNC,KAAK,EACLC,UAAU,EAC6C,EAEzD;QACE,IAAIA,WAAW,OAAO,CAAC,SAAS,IAC5B,OAAOA,WAAW,QAAQ,CAAC,OAAO;QAGtC,MAAMC,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QAEjD,IAAIC;QACJ,IAAI;YACAA,SAAS,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;gBAC7C,QAAQH,MAAM,MAAM;gBACpB,SAASA,MAAM,OAAO;gBACtB,WAAWA,MAAM,SAAS;gBAC1B,iBAAiBA,MAAM,eAAe;gBACtC,iBAAiBA,MAAM,eAAe;gBACtC,iBAAiBA,MAAM,eAAe;gBACtC,mBAAmBA,MAAM,iBAAiB;YAC9C;QACJ,EAAE,OAAOI,KAAK;YACV,MAAMC,UAAUD,eAAeE,QAAQF,IAAI,OAAO,GAAGG,OAAOH;YAC5D,MAAM,IAAI,CAAC,eAAe,CAACF,SAAS,EAAE,EAAEG;YACxC,OAAOJ,WAAW,QAAQ,CAAC,KAAK,CAAC;gBAAEI;YAAQ;QAC/C;QAEA,IAAIF,OAAO,MAAM,IAAI;YACjB,MAAM,IAAI,CAAC,eAAe,CAACD,SAAS,EAAE,EAAEC,OAAO,KAAK,CAAC,OAAO;YAE5D,OAAOF,WAAW,QAAQ,CAAC,KAAK,CAAC;gBAC7B,SAASE,OAAO,KAAK,CAAC,OAAO;YACjC;QACJ;QAIA,MAAMK,aAAa,MAAMC,aAAaN,OAAO,KAAK,CAAC,MAAM;QACzD,MAAMO,UAAUF,WAAW,QAAQ,CAAC;QAEpC,MAAM,IAAI,CAAC,iBAAiB,CAACN,SAAS,EAAE,EAAEQ,SAASP,OAAO,KAAK,CAAC,SAAS;QAEzE,OAAOF,WAAW,QAAQ,CAAC,IAAI,CAAC;IACpC;IAEA,MAAc,kBACVU,UAAkB,EAClBD,OAAe,EACfE,SAAwC,EAC1C;QACE,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B;YAAE,IAAID;QAAW,GACjB;YACI,QAAQ;YACR,MAAM;gBACF,aAAa;gBACb,OAAOD;gBACPE;YACJ;QACJ;IAER;IAEA,MAAc,gBAAgBD,UAAkB,EAAEN,OAAe,EAAE;QAC/D,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B;YAAE,IAAIM;QAAW,GACjB;YACI,QAAQ;YACR,MAAM;gBACFN;YACJ;QACJ;IAER;AACJ;AAEA,MAAMQ,qCAAqCC,YAAY,oBAAoB,CAAC;IACxE,gBAAgBlB;IAChB,cAAc;QAACmB;QAAiBC;QAAgCC;KAAgC;AACpG;AAEA,MAAMC;;aACF,EAAE,GAAGvB;aACL,KAAK,GAAG;aACR,WAAW,GAAG;aACd,aAAa,GAAG;aAChB,SAAS,GAAG;aACZ,YAAY,GAAG;aAEf,OAAO,GAAGkB;;AACd;AAEO,MAAMM,8BAA8BC,eAAe,oBAAoB,CAAC;IAC3E,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { Ai } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { AiSdkTools } from "@webiny/api-core/features/ai/index.js";
|
|
4
|
+
import { AiToolPipelineRunner } from "@webiny/api-core/features/ai/index.js";
|
|
5
|
+
import { ListTagsUseCase } from "@webiny/api-file-manager/features/file/ListTags/index.js";
|
|
6
|
+
import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
|
|
7
|
+
import { ModelToAstConverter } from "@webiny/api-headless-cms/features/contentModel/ModelToAstConverter/index.js";
|
|
8
|
+
import { ResolveAiCapabilityUseCase } from "../../../api/features/Capabilities/index.js";
|
|
9
|
+
import { AiPromptContextBuilder } from "../../../api/features/AiPromptContext/index.js";
|
|
10
|
+
import { CmsGenerateEntryContentUseCase } from "./abstractions.js";
|
|
11
|
+
import type { CmsGenerateEntryContentParams, GenerateEntryContentResult } from "./abstractions.js";
|
|
12
|
+
declare class CmsGenerateEntryContentUseCaseImpl implements CmsGenerateEntryContentUseCase.Interface {
|
|
13
|
+
private promptContextBuilder;
|
|
14
|
+
private resolveCapability;
|
|
15
|
+
private ai;
|
|
16
|
+
private aiSdkTools;
|
|
17
|
+
private listTags;
|
|
18
|
+
private getModel;
|
|
19
|
+
private modelToAst;
|
|
20
|
+
private toolPipelineRunner;
|
|
21
|
+
constructor(promptContextBuilder: AiPromptContextBuilder.Interface, resolveCapability: ResolveAiCapabilityUseCase.Interface, ai: Ai.Interface, aiSdkTools: AiSdkTools.Interface, listTags: ListTagsUseCase.Interface, getModel: GetModelUseCase.Interface, modelToAst: ModelToAstConverter.Interface, toolPipelineRunner: AiToolPipelineRunner.Interface);
|
|
22
|
+
execute<TValues = Record<string, any>>(params: CmsGenerateEntryContentParams): Promise<Result<GenerateEntryContentResult<TValues>, Error>>;
|
|
23
|
+
}
|
|
24
|
+
export declare const CmsGenerateEntryContentUseCaseImplementation: typeof CmsGenerateEntryContentUseCaseImpl & {
|
|
25
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICmsGenerateEntryContentUseCase>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|