@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,20 @@
|
|
|
1
|
+
import { FormModelFactory } from "@webiny/app-admin";
|
|
2
|
+
import type { FormModel } from "@webiny/app-admin";
|
|
3
|
+
import { AiPromptFormFactory as Abstraction, type AiPromptFormConfig } from "./abstractions.js";
|
|
4
|
+
import { GetSettingsUseCase } from "../../../admin/features/settings/getSettings/abstractions.js";
|
|
5
|
+
declare class AiPromptFormFactoryImpl implements Abstraction.Interface {
|
|
6
|
+
private formModelFactory;
|
|
7
|
+
private getSettings;
|
|
8
|
+
private _settings;
|
|
9
|
+
constructor(formModelFactory: FormModelFactory.Interface, getSettings: GetSettingsUseCase.Interface);
|
|
10
|
+
createForm(config?: AiPromptFormConfig): FormModel.Interface;
|
|
11
|
+
computeExcludedFileIds(form: FormModel.Interface): string[] | null;
|
|
12
|
+
private getProjectOptions;
|
|
13
|
+
private getPersonaOptions;
|
|
14
|
+
private loadSettings;
|
|
15
|
+
private getProjectFileOptions;
|
|
16
|
+
}
|
|
17
|
+
export declare const AiPromptFormFactory: typeof AiPromptFormFactoryImpl & {
|
|
18
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IAiPromptFormFactory>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { makeAutoObservable, runInAction } from "mobx";
|
|
2
|
+
import { FormModelFactory } from "@webiny/app-admin";
|
|
3
|
+
import { AiPromptFormFactory } from "./abstractions.js";
|
|
4
|
+
import { GetSettingsUseCase } from "../../features/settings/getSettings/abstractions.js";
|
|
5
|
+
class AiPromptFormFactoryImpl {
|
|
6
|
+
constructor(formModelFactory, getSettings){
|
|
7
|
+
this.formModelFactory = formModelFactory;
|
|
8
|
+
this.getSettings = getSettings;
|
|
9
|
+
this._settings = null;
|
|
10
|
+
makeAutoObservable(this, {}, {
|
|
11
|
+
autoBind: true
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
createForm(config) {
|
|
15
|
+
this.loadSettings();
|
|
16
|
+
return this.formModelFactory.create({
|
|
17
|
+
fields: (fields)=>({
|
|
18
|
+
project: fields.text().label("Project").description("Select a predefined context to attach.").options(()=>this.getProjectOptions()).afterChange((value, { form })=>{
|
|
19
|
+
const projectId = value;
|
|
20
|
+
const project = projectId ? this._settings?.projects?.presets?.find((p)=>p.id === projectId) : void 0;
|
|
21
|
+
if (project?.defaultReaderPersonaId) form.field("readerPersona").setValue(project.defaultReaderPersonaId);
|
|
22
|
+
if (project?.defaultWriterPersonaId) form.field("writerPersona").setValue(project.defaultWriterPersonaId);
|
|
23
|
+
const fileIds = (project?.files ?? []).map((f)=>f.id);
|
|
24
|
+
form.field("includedFiles").setValue(fileIds);
|
|
25
|
+
}),
|
|
26
|
+
includedFiles: fields.text().label("Files included").description("Uncheck files to exclude them from this generation only.").options(({ form })=>this.getProjectFileOptions(form)).renderer("multiSelect", {
|
|
27
|
+
showSelectionCount: true
|
|
28
|
+
}).list().hiddenWhen(({ form })=>{
|
|
29
|
+
const projectId = form.field("project").as("text").getValue();
|
|
30
|
+
if (!projectId) return true;
|
|
31
|
+
const project = this._settings?.projects?.presets?.find((p)=>p.id === projectId);
|
|
32
|
+
return !project?.files || 0 === project.files.length;
|
|
33
|
+
}),
|
|
34
|
+
readerPersona: fields.text().label("Reader Persona").description("Select the target audience for the generated content.").options(()=>this.getPersonaOptions("reader")),
|
|
35
|
+
writerPersona: fields.text().label("Writer Persona").description("Select the writing style for the generated content.").options(()=>this.getPersonaOptions("writer")),
|
|
36
|
+
prompt: fields.text().label("Prompt").description(config?.promptDescription ?? "Describe the content you want to generate.").required("Prompt is required").renderer("textarea", {
|
|
37
|
+
rows: 6
|
|
38
|
+
}).defaultValue(config?.promptDefaultValue ?? ""),
|
|
39
|
+
additionalFiles: fields.file().list().accept([
|
|
40
|
+
"text/*",
|
|
41
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
42
|
+
]).label("Additional files").description("Attach files as one-off context for this generation.")
|
|
43
|
+
}),
|
|
44
|
+
layout: (layout)=>[
|
|
45
|
+
layout.row("project"),
|
|
46
|
+
layout.row("includedFiles"),
|
|
47
|
+
layout.row("readerPersona"),
|
|
48
|
+
layout.row("writerPersona"),
|
|
49
|
+
layout.row("prompt"),
|
|
50
|
+
layout.row("additionalFiles")
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
computeExcludedFileIds(form) {
|
|
55
|
+
const projectId = form.field("project").getValue();
|
|
56
|
+
if (!projectId) return null;
|
|
57
|
+
const project = this._settings?.projects?.presets?.find((p)=>p.id === projectId);
|
|
58
|
+
const allFileIds = (project?.files ?? []).map((f)=>f.id);
|
|
59
|
+
if (0 === allFileIds.length) return null;
|
|
60
|
+
const includedFiles = form.field("includedFiles").getValue() ?? [];
|
|
61
|
+
const included = new Set(includedFiles);
|
|
62
|
+
const excluded = allFileIds.filter((id)=>!included.has(id));
|
|
63
|
+
return excluded.length > 0 ? excluded : null;
|
|
64
|
+
}
|
|
65
|
+
getProjectOptions() {
|
|
66
|
+
const presets = this._settings?.projects?.presets;
|
|
67
|
+
if (!presets || 0 === presets.length) return [];
|
|
68
|
+
return presets.map((preset)=>({
|
|
69
|
+
label: preset.name,
|
|
70
|
+
value: preset.id
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
getPersonaOptions(type) {
|
|
74
|
+
const presets = "reader" === type ? this._settings?.readerPersonas?.presets : this._settings?.writerPersonas?.presets;
|
|
75
|
+
if (!presets || 0 === presets.length) return [];
|
|
76
|
+
return presets.map((preset)=>({
|
|
77
|
+
label: preset.name,
|
|
78
|
+
value: preset.id
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
async loadSettings() {
|
|
82
|
+
const settings = await this.getSettings.execute();
|
|
83
|
+
runInAction(()=>{
|
|
84
|
+
this._settings = settings;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
getProjectFileOptions(form) {
|
|
88
|
+
const projectId = form.field("project").getValue();
|
|
89
|
+
if (!projectId) return [];
|
|
90
|
+
const project = this._settings?.projects?.presets?.find((p)=>p.id === projectId);
|
|
91
|
+
const files = project?.files;
|
|
92
|
+
if (!files || 0 === files.length) return [];
|
|
93
|
+
return files.map((f)=>({
|
|
94
|
+
label: f.name,
|
|
95
|
+
value: f.id
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const AiPromptFormFactory_AiPromptFormFactory = AiPromptFormFactory.createImplementation({
|
|
100
|
+
implementation: AiPromptFormFactoryImpl,
|
|
101
|
+
dependencies: [
|
|
102
|
+
FormModelFactory,
|
|
103
|
+
GetSettingsUseCase
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
export { AiPromptFormFactory_AiPromptFormFactory as AiPromptFormFactory };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=AiPromptFormFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/presentation/AiPromptFormFactory/AiPromptFormFactory.js","sources":["../../../../src/admin/presentation/AiPromptFormFactory/AiPromptFormFactory.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { FormModelFactory } from \"@webiny/app-admin\";\nimport type { FormModel } from \"@webiny/app-admin\";\nimport { AiPromptFormFactory as Abstraction, type AiPromptFormConfig } from \"./abstractions.js\";\nimport { GetSettingsUseCase } from \"~/admin/features/settings/getSettings/abstractions.js\";\nimport type { IAiPowerUpsSettings } from \"~/admin/features/settings/shared/abstractions.js\";\n\nclass AiPromptFormFactoryImpl implements Abstraction.Interface {\n private _settings: IAiPowerUpsSettings | null = null;\n\n constructor(\n private formModelFactory: FormModelFactory.Interface,\n private getSettings: GetSettingsUseCase.Interface\n ) {\n makeAutoObservable(this, {}, { autoBind: true });\n }\n\n createForm(config?: AiPromptFormConfig): FormModel.Interface {\n this.loadSettings();\n\n return this.formModelFactory.create({\n fields: fields => ({\n project: fields\n .text()\n .label(\"Project\")\n .description(\"Select a predefined context to attach.\")\n .options(() => this.getProjectOptions())\n .afterChange((value, { form }) => {\n const projectId = value as string | undefined;\n const project = projectId\n ? this._settings?.projects?.presets?.find(p => p.id === projectId)\n : undefined;\n\n if (project?.defaultReaderPersonaId) {\n form.field(\"readerPersona\").setValue(project.defaultReaderPersonaId);\n }\n if (project?.defaultWriterPersonaId) {\n form.field(\"writerPersona\").setValue(project.defaultWriterPersonaId);\n }\n\n const fileIds = (project?.files ?? []).map((f: { id: string }) => f.id);\n form.field(\"includedFiles\").setValue(fileIds);\n }),\n includedFiles: fields\n .text()\n .label(\"Files included\")\n .description(\"Uncheck files to exclude them from this generation only.\")\n .options(({ form }) => this.getProjectFileOptions(form))\n .renderer(\"multiSelect\", { showSelectionCount: true })\n .list()\n .hiddenWhen(({ form }) => {\n const projectId = form.field(\"project\").as(\"text\").getValue();\n if (!projectId) {\n return true;\n }\n const project = this._settings?.projects?.presets?.find(\n p => p.id === projectId\n );\n return !project?.files || project.files.length === 0;\n }),\n readerPersona: fields\n .text()\n .label(\"Reader Persona\")\n .description(\"Select the target audience for the generated content.\")\n .options(() => this.getPersonaOptions(\"reader\")),\n writerPersona: fields\n .text()\n .label(\"Writer Persona\")\n .description(\"Select the writing style for the generated content.\")\n .options(() => this.getPersonaOptions(\"writer\")),\n prompt: fields\n .text()\n .label(\"Prompt\")\n .description(\n config?.promptDescription ?? \"Describe the content you want to generate.\"\n )\n .required(\"Prompt is required\")\n .renderer(\"textarea\", { rows: 6 })\n .defaultValue(config?.promptDefaultValue ?? \"\"),\n additionalFiles: fields\n .file()\n .list()\n .accept([\n \"text/*\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ])\n .label(\"Additional files\")\n .description(\"Attach files as one-off context for this generation.\")\n }),\n layout: layout => [\n layout.row(\"project\"),\n layout.row(\"includedFiles\"),\n layout.row(\"readerPersona\"),\n layout.row(\"writerPersona\"),\n layout.row(\"prompt\"),\n layout.row(\"additionalFiles\")\n ]\n });\n }\n\n computeExcludedFileIds(form: FormModel.Interface): string[] | null {\n const projectId = form.field(\"project\").getValue<string>();\n if (!projectId) {\n return null;\n }\n const project = this._settings?.projects?.presets?.find(p => p.id === projectId);\n const allFileIds = (project?.files ?? []).map((f: { id: string }) => f.id);\n if (allFileIds.length === 0) {\n return null;\n }\n const includedFiles = form.field(\"includedFiles\").getValue<string[]>() ?? [];\n const included = new Set(includedFiles);\n const excluded = allFileIds.filter((id: string) => !included.has(id));\n return excluded.length > 0 ? excluded : null;\n }\n\n private getProjectOptions() {\n const presets = this._settings?.projects?.presets;\n if (!presets || presets.length === 0) {\n return [];\n }\n return presets.map(preset => ({\n label: preset.name,\n value: preset.id\n }));\n }\n\n private getPersonaOptions(type: \"reader\" | \"writer\") {\n const presets =\n type === \"reader\"\n ? this._settings?.readerPersonas?.presets\n : this._settings?.writerPersonas?.presets;\n\n if (!presets || presets.length === 0) {\n return [];\n }\n\n return presets.map(preset => ({\n label: preset.name,\n value: preset.id\n }));\n }\n\n private async loadSettings(): Promise<void> {\n const settings = await this.getSettings.execute();\n runInAction(() => {\n this._settings = settings;\n });\n }\n\n private getProjectFileOptions(form: FormModel.Interface) {\n const projectId = form.field(\"project\").getValue<string>();\n if (!projectId) {\n return [];\n }\n const project = this._settings?.projects?.presets?.find(p => p.id === projectId);\n const files = project?.files;\n if (!files || files.length === 0) {\n return [];\n }\n return files.map((f: { id: string; name: string }) => ({\n label: f.name,\n value: f.id\n }));\n }\n}\n\nexport const AiPromptFormFactory = Abstraction.createImplementation({\n implementation: AiPromptFormFactoryImpl,\n dependencies: [FormModelFactory, GetSettingsUseCase]\n});\n"],"names":["AiPromptFormFactoryImpl","formModelFactory","getSettings","makeAutoObservable","config","fields","value","form","projectId","project","p","undefined","fileIds","f","layout","allFileIds","includedFiles","included","Set","excluded","id","presets","preset","type","settings","runInAction","files","AiPromptFormFactory","Abstraction","FormModelFactory","GetSettingsUseCase"],"mappings":";;;;AAOA,MAAMA;IAGF,YACYC,gBAA4C,EAC5CC,WAAyC,CACnD;aAFUD,gBAAgB,GAAhBA;aACAC,WAAW,GAAXA;aAJJ,SAAS,GAA+B;QAM5CC,mBAAmB,IAAI,EAAE,CAAC,GAAG;YAAE,UAAU;QAAK;IAClD;IAEA,WAAWC,MAA2B,EAAuB;QACzD,IAAI,CAAC,YAAY;QAEjB,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;YAChC,QAAQC,CAAAA,SAAW;oBACf,SAASA,OACJ,IAAI,GACJ,KAAK,CAAC,WACN,WAAW,CAAC,0CACZ,OAAO,CAAC,IAAM,IAAI,CAAC,iBAAiB,IACpC,WAAW,CAAC,CAACC,OAAO,EAAEC,IAAI,EAAE;wBACzB,MAAMC,YAAYF;wBAClB,MAAMG,UAAUD,YACV,IAAI,CAAC,SAAS,EAAE,UAAU,SAAS,KAAKE,CAAAA,IAAKA,EAAE,EAAE,KAAKF,aACtDG;wBAEN,IAAIF,SAAS,wBACTF,KAAK,KAAK,CAAC,iBAAiB,QAAQ,CAACE,QAAQ,sBAAsB;wBAEvE,IAAIA,SAAS,wBACTF,KAAK,KAAK,CAAC,iBAAiB,QAAQ,CAACE,QAAQ,sBAAsB;wBAGvE,MAAMG,UAAWH,AAAAA,CAAAA,SAAS,SAAS,EAAC,EAAG,GAAG,CAAC,CAACI,IAAsBA,EAAE,EAAE;wBACtEN,KAAK,KAAK,CAAC,iBAAiB,QAAQ,CAACK;oBACzC;oBACJ,eAAeP,OACV,IAAI,GACJ,KAAK,CAAC,kBACN,WAAW,CAAC,4DACZ,OAAO,CAAC,CAAC,EAAEE,IAAI,EAAE,GAAK,IAAI,CAAC,qBAAqB,CAACA,OACjD,QAAQ,CAAC,eAAe;wBAAE,oBAAoB;oBAAK,GACnD,IAAI,GACJ,UAAU,CAAC,CAAC,EAAEA,IAAI,EAAE;wBACjB,MAAMC,YAAYD,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,QAAQ;wBAC3D,IAAI,CAACC,WACD,OAAO;wBAEX,MAAMC,UAAU,IAAI,CAAC,SAAS,EAAE,UAAU,SAAS,KAC/CC,CAAAA,IAAKA,EAAE,EAAE,KAAKF;wBAElB,OAAO,CAACC,SAAS,SAASA,AAAyB,MAAzBA,QAAQ,KAAK,CAAC,MAAM;oBAClD;oBACJ,eAAeJ,OACV,IAAI,GACJ,KAAK,CAAC,kBACN,WAAW,CAAC,yDACZ,OAAO,CAAC,IAAM,IAAI,CAAC,iBAAiB,CAAC;oBAC1C,eAAeA,OACV,IAAI,GACJ,KAAK,CAAC,kBACN,WAAW,CAAC,uDACZ,OAAO,CAAC,IAAM,IAAI,CAAC,iBAAiB,CAAC;oBAC1C,QAAQA,OACH,IAAI,GACJ,KAAK,CAAC,UACN,WAAW,CACRD,QAAQ,qBAAqB,8CAEhC,QAAQ,CAAC,sBACT,QAAQ,CAAC,YAAY;wBAAE,MAAM;oBAAE,GAC/B,YAAY,CAACA,QAAQ,sBAAsB;oBAChD,iBAAiBC,OACZ,IAAI,GACJ,IAAI,GACJ,MAAM,CAAC;wBACJ;wBACA;qBACH,EACA,KAAK,CAAC,oBACN,WAAW,CAAC;gBACrB;YACA,QAAQS,CAAAA,SAAU;oBACdA,OAAO,GAAG,CAAC;oBACXA,OAAO,GAAG,CAAC;oBACXA,OAAO,GAAG,CAAC;oBACXA,OAAO,GAAG,CAAC;oBACXA,OAAO,GAAG,CAAC;oBACXA,OAAO,GAAG,CAAC;iBACd;QACL;IACJ;IAEA,uBAAuBP,IAAyB,EAAmB;QAC/D,MAAMC,YAAYD,KAAK,KAAK,CAAC,WAAW,QAAQ;QAChD,IAAI,CAACC,WACD,OAAO;QAEX,MAAMC,UAAU,IAAI,CAAC,SAAS,EAAE,UAAU,SAAS,KAAKC,CAAAA,IAAKA,EAAE,EAAE,KAAKF;QACtE,MAAMO,aAAcN,AAAAA,CAAAA,SAAS,SAAS,EAAC,EAAG,GAAG,CAAC,CAACI,IAAsBA,EAAE,EAAE;QACzE,IAAIE,AAAsB,MAAtBA,WAAW,MAAM,EACjB,OAAO;QAEX,MAAMC,gBAAgBT,KAAK,KAAK,CAAC,iBAAiB,QAAQ,MAAgB,EAAE;QAC5E,MAAMU,WAAW,IAAIC,IAAIF;QACzB,MAAMG,WAAWJ,WAAW,MAAM,CAAC,CAACK,KAAe,CAACH,SAAS,GAAG,CAACG;QACjE,OAAOD,SAAS,MAAM,GAAG,IAAIA,WAAW;IAC5C;IAEQ,oBAAoB;QACxB,MAAME,UAAU,IAAI,CAAC,SAAS,EAAE,UAAU;QAC1C,IAAI,CAACA,WAAWA,AAAmB,MAAnBA,QAAQ,MAAM,EAC1B,OAAO,EAAE;QAEb,OAAOA,QAAQ,GAAG,CAACC,CAAAA,SAAW;gBAC1B,OAAOA,OAAO,IAAI;gBAClB,OAAOA,OAAO,EAAE;YACpB;IACJ;IAEQ,kBAAkBC,IAAyB,EAAE;QACjD,MAAMF,UACFE,AAAS,aAATA,OACM,IAAI,CAAC,SAAS,EAAE,gBAAgB,UAChC,IAAI,CAAC,SAAS,EAAE,gBAAgB;QAE1C,IAAI,CAACF,WAAWA,AAAmB,MAAnBA,QAAQ,MAAM,EAC1B,OAAO,EAAE;QAGb,OAAOA,QAAQ,GAAG,CAACC,CAAAA,SAAW;gBAC1B,OAAOA,OAAO,IAAI;gBAClB,OAAOA,OAAO,EAAE;YACpB;IACJ;IAEA,MAAc,eAA8B;QACxC,MAAME,WAAW,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO;QAC/CC,YAAY;YACR,IAAI,CAAC,SAAS,GAAGD;QACrB;IACJ;IAEQ,sBAAsBjB,IAAyB,EAAE;QACrD,MAAMC,YAAYD,KAAK,KAAK,CAAC,WAAW,QAAQ;QAChD,IAAI,CAACC,WACD,OAAO,EAAE;QAEb,MAAMC,UAAU,IAAI,CAAC,SAAS,EAAE,UAAU,SAAS,KAAKC,CAAAA,IAAKA,EAAE,EAAE,KAAKF;QACtE,MAAMkB,QAAQjB,SAAS;QACvB,IAAI,CAACiB,SAASA,AAAiB,MAAjBA,MAAM,MAAM,EACtB,OAAO,EAAE;QAEb,OAAOA,MAAM,GAAG,CAAC,CAACb,IAAqC;gBACnD,OAAOA,EAAE,IAAI;gBACb,OAAOA,EAAE,EAAE;YACf;IACJ;AACJ;AAEO,MAAMc,0CAAsBC,oBAAAA,oBAAgC,CAAC;IAChE,gBAAgB5B;IAChB,cAAc;QAAC6B;QAAkBC;KAAmB;AACxD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FormModel } from "@webiny/app-admin";
|
|
2
|
+
export interface AiPromptFormConfig {
|
|
3
|
+
promptDescription?: string;
|
|
4
|
+
promptDefaultValue?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IAiPromptFormFactory {
|
|
7
|
+
createForm(config?: AiPromptFormConfig): FormModel.Interface;
|
|
8
|
+
computeExcludedFileIds(form: FormModel.Interface): string[] | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const AiPromptFormFactory: import("@webiny/di").Abstraction<IAiPromptFormFactory>;
|
|
11
|
+
export declare namespace AiPromptFormFactory {
|
|
12
|
+
type Interface = IAiPromptFormFactory;
|
|
13
|
+
type Config = AiPromptFormConfig;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/presentation/AiPromptFormFactory/abstractions.js","sources":["../../../../src/admin/presentation/AiPromptFormFactory/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { FormModel } from \"@webiny/app-admin\";\n\nexport interface AiPromptFormConfig {\n promptDescription?: string;\n promptDefaultValue?: string;\n}\n\nexport interface IAiPromptFormFactory {\n createForm(config?: AiPromptFormConfig): FormModel.Interface;\n computeExcludedFileIds(form: FormModel.Interface): string[] | null;\n}\n\nexport const AiPromptFormFactory = createAbstraction<IAiPromptFormFactory>(\"AiPromptFormFactory\");\n\nexport namespace AiPromptFormFactory {\n export type Interface = IAiPromptFormFactory;\n export type Config = AiPromptFormConfig;\n}\n"],"names":["AiPromptFormFactory","createAbstraction"],"mappings":";AAaO,MAAMA,sBAAsBC,kBAAwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AiPromptFormFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { AiPromptFormFactory } from "./AiPromptFormFactory.js";
|
|
3
|
+
const AiPromptFormFeature = createFeature({
|
|
4
|
+
name: "AiPowerUps/PromptFormFactory",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(AiPromptFormFactory);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { AiPromptFormFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/presentation/AiPromptFormFactory/feature.js","sources":["../../../../src/admin/presentation/AiPromptFormFactory/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { AiPromptFormFactory } from \"./AiPromptFormFactory.js\";\n\nexport const AiPromptFormFeature = createFeature({\n name: \"AiPowerUps/PromptFormFactory\",\n register(container) {\n container.register(AiPromptFormFactory);\n }\n});\n"],"names":["AiPromptFormFeature","createFeature","container","AiPromptFormFactory"],"mappings":";;AAGO,MAAMA,sBAAsBC,cAAc;IAC7C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AiPowerUpsSettingsGroup } from "./AiPowerUpsSettings/settingsGroup.js";
|
|
2
|
+
import { ListCapabilitiesUseCase, ListCapabilitiesRepository } from "../../admin/features/listCapabilities/abstractions.js";
|
|
3
|
+
import { ListModelsUseCase, ListModelsRepository } from "../../admin/features/listModels/abstractions.js";
|
|
4
|
+
/**
|
|
5
|
+
* One row per AI feature, all of them empty by default.
|
|
6
|
+
*
|
|
7
|
+
* The rows come from the api's registered capabilities, so a feature that declares one appears here
|
|
8
|
+
* without a change to this file. That is the point: the previous plan was a hand-maintained tab per
|
|
9
|
+
* feature, which is the kind of list that stops matching reality on the second addition.
|
|
10
|
+
*/
|
|
11
|
+
declare class CapabilitiesSettingsImpl implements AiPowerUpsSettingsGroup.Interface {
|
|
12
|
+
private listCapabilities;
|
|
13
|
+
private capabilitiesRepository;
|
|
14
|
+
private listModels;
|
|
15
|
+
private modelsRepository;
|
|
16
|
+
name: string;
|
|
17
|
+
label: string;
|
|
18
|
+
description: string;
|
|
19
|
+
constructor(listCapabilities: ListCapabilitiesUseCase.Interface, capabilitiesRepository: ListCapabilitiesRepository.Interface, listModels: ListModelsUseCase.Interface, modelsRepository: ListModelsRepository.Interface);
|
|
20
|
+
init(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Alphabetical by the label people actually read, not by id or registration order.
|
|
23
|
+
*
|
|
24
|
+
* Registration order is whatever the container happened to do, which puts "Page generation"
|
|
25
|
+
* above "CMS entry generation" for no reason a reader could infer. `localeCompare` rather than
|
|
26
|
+
* `<` so accented labels from an extension sort where a person would expect.
|
|
27
|
+
*/
|
|
28
|
+
private sortedCapabilities;
|
|
29
|
+
buildForm(form: AiPowerUpsSettingsGroup.FormBuilder): void;
|
|
30
|
+
private buildCapabilityField;
|
|
31
|
+
private getConnections;
|
|
32
|
+
private getOverride;
|
|
33
|
+
private getPinnedConnection;
|
|
34
|
+
private getModelOptions;
|
|
35
|
+
}
|
|
36
|
+
export declare const CapabilitiesSettings: typeof CapabilitiesSettingsImpl & {
|
|
37
|
+
__abstraction: import("@webiny/di").Abstraction<import("./AiPowerUpsSettings/settingsGroup.js").IAiPowerUpsSettingsGroup>;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { AiPowerUpsSettingsGroup } from "./AiPowerUpsSettings/settingsGroup.js";
|
|
2
|
+
import { ListCapabilitiesRepository, ListCapabilitiesUseCase } from "../features/listCapabilities/abstractions.js";
|
|
3
|
+
import { ListModelsRepository, ListModelsUseCase } from "../features/listModels/abstractions.js";
|
|
4
|
+
import { AI_MODEL_ROLE_DISPLAY, roleLabel } from "./modelRoles.js";
|
|
5
|
+
function isEnabled(form, capabilityId) {
|
|
6
|
+
const data = form.getData();
|
|
7
|
+
return data.capabilities?.items?.[capabilityId]?.enabled !== false;
|
|
8
|
+
}
|
|
9
|
+
class CapabilitiesSettingsImpl {
|
|
10
|
+
constructor(listCapabilities, capabilitiesRepository, listModels, modelsRepository){
|
|
11
|
+
this.listCapabilities = listCapabilities;
|
|
12
|
+
this.capabilitiesRepository = capabilitiesRepository;
|
|
13
|
+
this.listModels = listModels;
|
|
14
|
+
this.modelsRepository = modelsRepository;
|
|
15
|
+
this.name = "capabilities";
|
|
16
|
+
this.label = "Capabilities";
|
|
17
|
+
this.description = "Per-feature model and prompt overrides. Empty means inherit.";
|
|
18
|
+
}
|
|
19
|
+
async init() {
|
|
20
|
+
await Promise.all([
|
|
21
|
+
this.listCapabilities.execute(),
|
|
22
|
+
this.listModels.execute()
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
sortedCapabilities() {
|
|
26
|
+
return [
|
|
27
|
+
...this.capabilitiesRepository.getCapabilities()
|
|
28
|
+
].sort((a, b)=>a.label.localeCompare(b.label));
|
|
29
|
+
}
|
|
30
|
+
buildForm(form) {
|
|
31
|
+
form.fields((fields)=>({
|
|
32
|
+
items: fields.object().label("Capabilities").renderer("passthrough").fields((f)=>Object.fromEntries(this.sortedCapabilities().map((capability)=>[
|
|
33
|
+
capability.id,
|
|
34
|
+
this.buildCapabilityField(f, capability)
|
|
35
|
+
])))
|
|
36
|
+
}));
|
|
37
|
+
form.layout((layout)=>[
|
|
38
|
+
layout.row("items")
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
buildCapabilityField(f, capability) {
|
|
42
|
+
const defaultRoleLabel = roleLabel(capability.defaultRole);
|
|
43
|
+
return f.object().label(capability.label).renderer("objectAccordionSingle", {
|
|
44
|
+
itemTitle: ()=>capability.label,
|
|
45
|
+
itemDescription: ()=>capability.description,
|
|
46
|
+
open: false
|
|
47
|
+
}).fields((cf)=>({
|
|
48
|
+
enabled: cf.boolean().label("Enabled").defaultValue(true).description("Turn this off to remove the feature from the app. The settings below are kept, but ignored, while it is off."),
|
|
49
|
+
overrides: cf.object().label("Overrides").renderer("passthrough").fields((of)=>({
|
|
50
|
+
roleId: of.text().label("Model role").disabledWhen(({ form })=>!isEnabled(form, capability.id)).description(`Which role supplies this feature's model. Left empty, it uses ${defaultRoleLabel}.`).options(()=>AI_MODEL_ROLE_DISPLAY.map((role)=>({
|
|
51
|
+
label: role.label,
|
|
52
|
+
value: role.id
|
|
53
|
+
}))),
|
|
54
|
+
connectionId: of.text().label("Pin a connection").disabledWhen(({ form })=>!isEnabled(form, capability.id)).description("Advanced. Overrides the role above for this feature only.").options(({ form })=>[
|
|
55
|
+
{
|
|
56
|
+
label: "Use the role's connection",
|
|
57
|
+
value: ""
|
|
58
|
+
},
|
|
59
|
+
...this.getConnections(form).map((c)=>({
|
|
60
|
+
label: c.name,
|
|
61
|
+
value: c.id
|
|
62
|
+
}))
|
|
63
|
+
]),
|
|
64
|
+
model: of.text().label("Pin a model").disabledWhen(({ form })=>!isEnabled(form, capability.id) || !this.getPinnedConnection(form, capability.id)).description("Both the connection and the model must be set for a pin to apply.").options(({ form })=>this.getModelOptions(form, capability.id)),
|
|
65
|
+
additionalInstructions: of.text().label("Additional instructions").renderer("textarea", {
|
|
66
|
+
rows: 5
|
|
67
|
+
}).disabledWhen(({ form })=>!isEnabled(form, capability.id)).description("Appended to this feature's prompt. Use this for house style and standing rules.").note("Appending keeps Webiny's prompt in place, including the output format the feature depends on.")
|
|
68
|
+
}))
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
getConnections(form) {
|
|
72
|
+
const data = form.getData();
|
|
73
|
+
return (data.connections?.presets ?? []).filter((c)=>c.id && c.name);
|
|
74
|
+
}
|
|
75
|
+
getOverride(form, capabilityId) {
|
|
76
|
+
const data = form.getData();
|
|
77
|
+
return data.capabilities?.items?.[capabilityId]?.overrides ?? {};
|
|
78
|
+
}
|
|
79
|
+
getPinnedConnection(form, capabilityId) {
|
|
80
|
+
const connectionId = this.getOverride(form, capabilityId).connectionId;
|
|
81
|
+
if (!connectionId) return;
|
|
82
|
+
return this.getConnections(form).find((c)=>c.id === connectionId);
|
|
83
|
+
}
|
|
84
|
+
getModelOptions(form, capabilityId) {
|
|
85
|
+
const connection = this.getPinnedConnection(form, capabilityId);
|
|
86
|
+
if (!connection) return [];
|
|
87
|
+
return this.modelsRepository.getModels().filter((model)=>model.providerId === connection.sdkName).map((model)=>({
|
|
88
|
+
label: model.modelName,
|
|
89
|
+
value: `${model.providerId}/${model.modelId}`
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const CapabilitiesSettings = AiPowerUpsSettingsGroup.createImplementation({
|
|
94
|
+
implementation: CapabilitiesSettingsImpl,
|
|
95
|
+
dependencies: [
|
|
96
|
+
ListCapabilitiesUseCase,
|
|
97
|
+
ListCapabilitiesRepository,
|
|
98
|
+
ListModelsUseCase,
|
|
99
|
+
ListModelsRepository
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
export { CapabilitiesSettings };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=CapabilitiesSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/presentation/CapabilitiesSettings.js","sources":["../../../src/admin/presentation/CapabilitiesSettings.ts"],"sourcesContent":["import type { IAiPowerUpsConnectionPreset } from \"~/admin/features/settings/shared/abstractions.js\";\nimport { AiPowerUpsSettingsGroup } from \"./AiPowerUpsSettings/settingsGroup.js\";\nimport {\n ListCapabilitiesUseCase,\n ListCapabilitiesRepository\n} from \"~/admin/features/listCapabilities/abstractions.js\";\nimport {\n ListModelsUseCase,\n ListModelsRepository\n} from \"~/admin/features/listModels/abstractions.js\";\nimport { AI_MODEL_ROLE_DISPLAY, roleLabel } from \"./modelRoles.js\";\nimport type { AiCapability } from \"~/admin/features/listCapabilities/abstractions.js\";\nimport type { FormModel, FormModelFactory } from \"@webiny/app-admin\";\n\n/**\n * Absent means enabled, exactly as it does in storage and in the resolver.\n *\n * The form seeds an untouched switch to `true`, so in practice this only reads `false` after someone\n * flips one. Spelled `!== false` anyway, so it keeps agreeing with the other two if that default\n * ever goes away.\n */\nfunction isEnabled(form: FormModel.Interface, capabilityId: string): boolean {\n const data = form.getData() as {\n capabilities?: { items?: Record<string, { enabled?: boolean }> };\n };\n return data.capabilities?.items?.[capabilityId]?.enabled !== false;\n}\n\n/**\n * One row per AI feature, all of them empty by default.\n *\n * The rows come from the api's registered capabilities, so a feature that declares one appears here\n * without a change to this file. That is the point: the previous plan was a hand-maintained tab per\n * feature, which is the kind of list that stops matching reality on the second addition.\n */\nclass CapabilitiesSettingsImpl implements AiPowerUpsSettingsGroup.Interface {\n name = \"capabilities\";\n label = \"Capabilities\";\n description = \"Per-feature model and prompt overrides. Empty means inherit.\";\n\n constructor(\n private listCapabilities: ListCapabilitiesUseCase.Interface,\n private capabilitiesRepository: ListCapabilitiesRepository.Interface,\n private listModels: ListModelsUseCase.Interface,\n private modelsRepository: ListModelsRepository.Interface\n ) {}\n\n async init(): Promise<void> {\n await Promise.all([this.listCapabilities.execute(), this.listModels.execute()]);\n }\n\n /**\n * Alphabetical by the label people actually read, not by id or registration order.\n *\n * Registration order is whatever the container happened to do, which puts \"Page generation\"\n * above \"CMS entry generation\" for no reason a reader could infer. `localeCompare` rather than\n * `<` so accented labels from an extension sort where a person would expect.\n */\n private sortedCapabilities(): AiCapability[] {\n return [...this.capabilitiesRepository.getCapabilities()].sort((a, b) =>\n a.label.localeCompare(b.label)\n );\n }\n\n buildForm(form: AiPowerUpsSettingsGroup.FormBuilder): void {\n form.fields(fields => ({\n items: fields\n .object()\n .label(\"Capabilities\")\n .renderer(\"passthrough\")\n .fields(f =>\n Object.fromEntries(\n this.sortedCapabilities().map(capability => [\n capability.id,\n this.buildCapabilityField(f, capability)\n ])\n )\n )\n }));\n\n form.layout(layout => [layout.row(\"items\")]);\n }\n\n private buildCapabilityField(\n f: FormModelFactory.FieldBuilderRegistry,\n capability: AiCapability\n ): FormModelFactory.FieldBuilder {\n const defaultRoleLabel = roleLabel(capability.defaultRole);\n\n return (\n f\n .object()\n .label(capability.label)\n /*\n * Callbacks, not strings: a string is read as a field name, not as literal text. The\n * title happened to survive that because the renderer falls back to the field label,\n * but the description silently vanished.\n */\n .renderer(\"objectAccordionSingle\", {\n itemTitle: () => capability.label,\n itemDescription: () => capability.description,\n // Closed by default. Every row is empty until someone changes something, so an\n // expanded list of five would be five screens of nothing.\n open: false\n })\n .fields(cf => ({\n /*\n * On unless someone turns it off. A licence that grants a capability enables it\n * immediately, so nobody has to come here and opt in; the only thing this\n * records is a decision to switch one off.\n */\n enabled: cf\n .boolean()\n .label(\"Enabled\")\n /*\n * On unless storage explicitly says otherwise. Nothing is written down for a\n * capability a licence enabled, so the stored value is absent, and a switch\n * renders absent as off. Without this default every untouched capability\n * shows as disabled while actually running, which is the same `undefined`\n * confusion the storage side guards against, seen from the front.\n */\n .defaultValue(true)\n .description(\n \"Turn this off to remove the feature from the app. The settings below are kept, but ignored, while it is off.\"\n ),\n\n overrides: cf\n .object()\n .label(\"Overrides\")\n .renderer(\"passthrough\")\n .fields(of => ({\n /*\n * The inherited role goes in the description, not in the option list. An option\n * with an empty value is dropped by the select renderer, so the \"Inherit (Fast)\"\n * entry never rendered and nothing said which role this feature falls back to.\n * Clearing the field is done with the select's own reset control.\n */\n roleId: of\n .text()\n .label(\"Model role\")\n .disabledWhen(({ form }) => !isEnabled(form, capability.id))\n .description(\n `Which role supplies this feature's model. Left empty, it uses ${defaultRoleLabel}.`\n )\n .options(() =>\n AI_MODEL_ROLE_DISPLAY.map(role => ({\n label: role.label,\n value: role.id\n }))\n ),\n\n /*\n * Pinning a model bypasses roles for this one feature. It is the escape hatch, not\n * the mechanism: a project that pins everything has thrown away the indirection\n * that makes \"switch our cheap model\" a single edit.\n */\n connectionId: of\n .text()\n .label(\"Pin a connection\")\n .disabledWhen(({ form }) => !isEnabled(form, capability.id))\n .description(\n \"Advanced. Overrides the role above for this feature only.\"\n )\n .options(({ form }) => [\n { label: \"Use the role's connection\", value: \"\" },\n ...this.getConnections(form).map(c => ({\n label: c.name,\n value: c.id\n }))\n ]),\n model: of\n .text()\n .label(\"Pin a model\")\n .disabledWhen(\n ({ form }) =>\n !isEnabled(form, capability.id) ||\n !this.getPinnedConnection(form, capability.id)\n )\n .description(\n \"Both the connection and the model must be set for a pin to apply.\"\n )\n .options(({ form }) => this.getModelOptions(form, capability.id)),\n\n additionalInstructions: of\n .text()\n .label(\"Additional instructions\")\n .renderer(\"textarea\", { rows: 5 })\n .disabledWhen(({ form }) => !isEnabled(form, capability.id))\n .description(\n \"Appended to this feature's prompt. Use this for house style and standing rules.\"\n )\n .note(\n \"Appending keeps Webiny's prompt in place, including the output format the feature depends on.\"\n )\n }))\n }))\n );\n }\n\n private getConnections(form: FormModel.Interface): IAiPowerUpsConnectionPreset[] {\n const data = form.getData() as {\n connections?: { presets?: IAiPowerUpsConnectionPreset[] };\n };\n return (data.connections?.presets ?? []).filter(c => c.id && c.name);\n }\n\n private getOverride(\n form: FormModel.Interface,\n capabilityId: string\n ): { connectionId?: string } {\n const data = form.getData() as {\n capabilities?: { items?: Record<string, { overrides?: { connectionId?: string } }> };\n };\n return data.capabilities?.items?.[capabilityId]?.overrides ?? {};\n }\n\n private getPinnedConnection(\n form: FormModel.Interface,\n capabilityId: string\n ): IAiPowerUpsConnectionPreset | undefined {\n const connectionId = this.getOverride(form, capabilityId).connectionId;\n\n if (!connectionId) {\n return undefined;\n }\n\n return this.getConnections(form).find(c => c.id === connectionId);\n }\n\n private getModelOptions(form: FormModel.Interface, capabilityId: string) {\n const connection = this.getPinnedConnection(form, capabilityId);\n\n if (!connection) {\n return [];\n }\n\n return this.modelsRepository\n .getModels()\n .filter(model => model.providerId === connection.sdkName)\n .map(model => ({\n label: model.modelName,\n value: `${model.providerId}/${model.modelId}`\n }));\n }\n}\n\nexport const CapabilitiesSettings = AiPowerUpsSettingsGroup.createImplementation({\n implementation: CapabilitiesSettingsImpl,\n dependencies: [\n ListCapabilitiesUseCase,\n ListCapabilitiesRepository,\n ListModelsUseCase,\n ListModelsRepository\n ]\n});\n"],"names":["isEnabled","form","capabilityId","data","CapabilitiesSettingsImpl","listCapabilities","capabilitiesRepository","listModels","modelsRepository","Promise","a","b","fields","f","Object","capability","layout","defaultRoleLabel","roleLabel","cf","of","AI_MODEL_ROLE_DISPLAY","role","c","connectionId","connection","model","CapabilitiesSettings","AiPowerUpsSettingsGroup","ListCapabilitiesUseCase","ListCapabilitiesRepository","ListModelsUseCase","ListModelsRepository"],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CmsCompareEntryRevisionsPresenter } from "./abstractions.js";
|
|
3
|
+
interface CmsCompareEntryRevisionsDialogProps {
|
|
4
|
+
presenter: CmsCompareEntryRevisionsPresenter.Interface;
|
|
5
|
+
}
|
|
6
|
+
export declare const CmsCompareEntryRevisionsDialog: (({ presenter }: CmsCompareEntryRevisionsDialogProps) => React.JSX.Element) & React.NamedExoticComponent<CmsCompareEntryRevisionsDialogProps> & {
|
|
7
|
+
readonly type: ({ presenter }: CmsCompareEntryRevisionsDialogProps) => React.JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { createReactiveComponent } from "@webiny/app-admin";
|
|
3
|
+
import { Alert, Button, Dialog } from "@webiny/admin-ui";
|
|
4
|
+
const COMPARISON_STYLES = `
|
|
5
|
+
.comparison-report {
|
|
6
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
7
|
+
line-height: 1.6;
|
|
8
|
+
color: #333;
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
overflow-x: auto;
|
|
11
|
+
}
|
|
12
|
+
.comparison-report h2 {
|
|
13
|
+
color: #2563eb;
|
|
14
|
+
border-bottom: 2px solid #e5e7eb;
|
|
15
|
+
padding-bottom: 0.5rem;
|
|
16
|
+
margin-bottom: 1.5rem;
|
|
17
|
+
font-size: 1.5rem;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
}
|
|
20
|
+
.comparison-table {
|
|
21
|
+
width: 100%;
|
|
22
|
+
border-collapse: collapse;
|
|
23
|
+
margin-top: 1rem;
|
|
24
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
25
|
+
border-radius: 0.5rem;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
table-layout: fixed;
|
|
28
|
+
}
|
|
29
|
+
.comparison-table thead {
|
|
30
|
+
background-color: #f8fafc;
|
|
31
|
+
position: sticky;
|
|
32
|
+
top: 0;
|
|
33
|
+
z-index: 10;
|
|
34
|
+
}
|
|
35
|
+
.comparison-table th {
|
|
36
|
+
padding: 0.75rem 0.5rem;
|
|
37
|
+
text-align: left;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
color: #374151;
|
|
40
|
+
border-bottom: 2px solid #e5e7eb;
|
|
41
|
+
font-size: 0.875rem;
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
}
|
|
44
|
+
.comparison-table th:first-child { width: 15%; min-width: 120px; }
|
|
45
|
+
.comparison-table th:nth-child(2),
|
|
46
|
+
.comparison-table th:nth-child(3) { width: 30%; min-width: 200px; }
|
|
47
|
+
.comparison-table th:last-child { width: 25%; min-width: 180px; }
|
|
48
|
+
.comparison-table td {
|
|
49
|
+
padding: 0.75rem 0.5rem;
|
|
50
|
+
border-bottom: 1px solid #f3f4f6;
|
|
51
|
+
vertical-align: top;
|
|
52
|
+
word-wrap: break-word;
|
|
53
|
+
overflow-wrap: break-word;
|
|
54
|
+
max-width: 0;
|
|
55
|
+
}
|
|
56
|
+
.comparison-table tr:hover { background-color: #f9fafb; }
|
|
57
|
+
.comparison-table tr:last-child td { border-bottom: none; }
|
|
58
|
+
.comparison-table strong {
|
|
59
|
+
color: #1f2937;
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
display: block;
|
|
62
|
+
margin-bottom: 0.25rem;
|
|
63
|
+
}
|
|
64
|
+
.comparison-table .field-changed { background-color: #fef3c7; }
|
|
65
|
+
.comparison-table .field-added { background-color: #d1fae5; }
|
|
66
|
+
.comparison-table .field-removed { background-color: #fee2e2; }
|
|
67
|
+
.comparison-table .value-old { color: #dc2626; text-decoration: line-through; }
|
|
68
|
+
.comparison-table .value-new { color: #059669; font-weight: 500; }
|
|
69
|
+
.comparison-table .change-summary { font-style: italic; color: #4b5563; }
|
|
70
|
+
.no-changes {
|
|
71
|
+
text-align: center;
|
|
72
|
+
padding: 2rem;
|
|
73
|
+
color: #6b7280;
|
|
74
|
+
font-style: italic;
|
|
75
|
+
background-color: #f9fafb;
|
|
76
|
+
border-radius: 0.5rem;
|
|
77
|
+
border: 1px dashed #d1d5db;
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
const CmsCompareEntryRevisionsDialog = createReactiveComponent(({ presenter })=>{
|
|
81
|
+
const { dialogVisible, comparing, error, result } = presenter.vm;
|
|
82
|
+
const renderContent = ()=>{
|
|
83
|
+
if (error) return /*#__PURE__*/ react.createElement(Alert, {
|
|
84
|
+
type: "danger",
|
|
85
|
+
title: "Comparison Error"
|
|
86
|
+
}, error);
|
|
87
|
+
if (result) return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement("style", null, COMPARISON_STYLES), /*#__PURE__*/ react.createElement("div", {
|
|
88
|
+
className: "wby-prose wby-max-w-none",
|
|
89
|
+
dangerouslySetInnerHTML: {
|
|
90
|
+
__html: result.html
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
if (!comparing) return /*#__PURE__*/ react.createElement("div", {
|
|
94
|
+
className: "wby-text-center wby-py-lg wby-text-neutral-subtle"
|
|
95
|
+
}, "No comparison data available.");
|
|
96
|
+
return null;
|
|
97
|
+
};
|
|
98
|
+
return /*#__PURE__*/ react.createElement(Dialog, {
|
|
99
|
+
open: dialogVisible,
|
|
100
|
+
onOpenChange: (open)=>{
|
|
101
|
+
if (!open) presenter.hideDialog();
|
|
102
|
+
},
|
|
103
|
+
title: "Compare Revisions",
|
|
104
|
+
size: "full",
|
|
105
|
+
loading: comparing ? {
|
|
106
|
+
text: "Comparing revisions with AI..."
|
|
107
|
+
} : false,
|
|
108
|
+
actions: /*#__PURE__*/ react.createElement(Button, {
|
|
109
|
+
variant: "secondary",
|
|
110
|
+
onClick: ()=>presenter.hideDialog(),
|
|
111
|
+
text: "Close"
|
|
112
|
+
}),
|
|
113
|
+
"data-testid": "cms.compare-revisions.dialog"
|
|
114
|
+
}, renderContent());
|
|
115
|
+
});
|
|
116
|
+
export { CmsCompareEntryRevisionsDialog };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=CmsCompareEntryRevisionsDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDialog.js","sources":["../../../../src/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { createReactiveComponent } from \"@webiny/app-admin\";\nimport { Dialog, Button, Alert } from \"@webiny/admin-ui\";\nimport type { CmsCompareEntryRevisionsPresenter } from \"./abstractions.js\";\n\ninterface CmsCompareEntryRevisionsDialogProps {\n presenter: CmsCompareEntryRevisionsPresenter.Interface;\n}\n\nconst COMPARISON_STYLES = `\n .comparison-report {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n line-height: 1.6;\n color: #333;\n max-width: 100%;\n overflow-x: auto;\n }\n .comparison-report h2 {\n color: #2563eb;\n border-bottom: 2px solid #e5e7eb;\n padding-bottom: 0.5rem;\n margin-bottom: 1.5rem;\n font-size: 1.5rem;\n font-weight: 700;\n }\n .comparison-table {\n width: 100%;\n border-collapse: collapse;\n margin-top: 1rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n border-radius: 0.5rem;\n overflow: hidden;\n table-layout: fixed;\n }\n .comparison-table thead {\n background-color: #f8fafc;\n position: sticky;\n top: 0;\n z-index: 10;\n }\n .comparison-table th {\n padding: 0.75rem 0.5rem;\n text-align: left;\n font-weight: 600;\n color: #374151;\n border-bottom: 2px solid #e5e7eb;\n font-size: 0.875rem;\n white-space: nowrap;\n }\n .comparison-table th:first-child { width: 15%; min-width: 120px; }\n .comparison-table th:nth-child(2),\n .comparison-table th:nth-child(3) { width: 30%; min-width: 200px; }\n .comparison-table th:last-child { width: 25%; min-width: 180px; }\n .comparison-table td {\n padding: 0.75rem 0.5rem;\n border-bottom: 1px solid #f3f4f6;\n vertical-align: top;\n word-wrap: break-word;\n overflow-wrap: break-word;\n max-width: 0;\n }\n .comparison-table tr:hover { background-color: #f9fafb; }\n .comparison-table tr:last-child td { border-bottom: none; }\n .comparison-table strong {\n color: #1f2937;\n font-weight: 600;\n display: block;\n margin-bottom: 0.25rem;\n }\n .comparison-table .field-changed { background-color: #fef3c7; }\n .comparison-table .field-added { background-color: #d1fae5; }\n .comparison-table .field-removed { background-color: #fee2e2; }\n .comparison-table .value-old { color: #dc2626; text-decoration: line-through; }\n .comparison-table .value-new { color: #059669; font-weight: 500; }\n .comparison-table .change-summary { font-style: italic; color: #4b5563; }\n .no-changes {\n text-align: center;\n padding: 2rem;\n color: #6b7280;\n font-style: italic;\n background-color: #f9fafb;\n border-radius: 0.5rem;\n border: 1px dashed #d1d5db;\n }\n`;\n\nexport const CmsCompareEntryRevisionsDialog = createReactiveComponent(\n ({ presenter }: CmsCompareEntryRevisionsDialogProps) => {\n const { dialogVisible, comparing, error, result } = presenter.vm;\n\n const renderContent = () => {\n if (error) {\n return (\n <Alert type={\"danger\"} title={\"Comparison Error\"}>\n {error}\n </Alert>\n );\n }\n\n if (result) {\n return (\n <>\n <style>{COMPARISON_STYLES}</style>\n <div\n className={\"wby-prose wby-max-w-none\"}\n dangerouslySetInnerHTML={{\n __html: result.html\n }}\n />\n </>\n );\n }\n\n if (!comparing) {\n return (\n <div className={\"wby-text-center wby-py-lg wby-text-neutral-subtle\"}>\n No comparison data available.\n </div>\n );\n }\n\n return null;\n };\n\n return (\n <Dialog\n open={dialogVisible}\n onOpenChange={open => {\n if (!open) {\n presenter.hideDialog();\n }\n }}\n title={\"Compare Revisions\"}\n size={\"full\"}\n loading={comparing ? { text: \"Comparing revisions with AI...\" } : false}\n actions={\n <Button\n variant={\"secondary\"}\n onClick={() => presenter.hideDialog()}\n text={\"Close\"}\n />\n }\n data-testid={\"cms.compare-revisions.dialog\"}\n >\n {renderContent()}\n </Dialog>\n );\n }\n);\n"],"names":["COMPARISON_STYLES","CmsCompareEntryRevisionsDialog","createReactiveComponent","presenter","dialogVisible","comparing","error","result","renderContent","Alert","Dialog","open","Button"],"mappings":";;;AASA,MAAMA,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2E3B,CAAC;AAEM,MAAMC,iCAAiCC,wBAC1C,CAAC,EAAEC,SAAS,EAAuC;IAC/C,MAAM,EAAEC,aAAa,EAAEC,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAE,GAAGJ,UAAU,EAAE;IAEhE,MAAMK,gBAAgB;QAClB,IAAIF,OACA,OAAO,WAAP,GACI,oBAACG,OAAKA;YAAC,MAAM;YAAU,OAAO;WACzBH;QAKb,IAAIC,QACA,OAAO,WAAP,GACI,wDACI,oBAAC,eAAOP,oBAAiBA,WAAAA,GACzB,oBAAC;YACG,WAAW;YACX,yBAAyB;gBACrB,QAAQO,OAAO,IAAI;YACvB;;QAMhB,IAAI,CAACF,WACD,OAAO,WAAP,GACI,oBAAC;YAAI,WAAW;WAAqD;QAM7E,OAAO;IACX;IAEA,OAAO,WAAP,GACI,oBAACK,QAAMA;QACH,MAAMN;QACN,cAAcO,CAAAA;YACV,IAAI,CAACA,MACDR,UAAU,UAAU;QAE5B;QACA,OAAO;QACP,MAAM;QACN,SAASE,YAAY;YAAE,MAAM;QAAiC,IAAI;QAClE,uBACI,oBAACO,QAAMA;YACH,SAAS;YACT,SAAS,IAAMT,UAAU,UAAU;YACnC,MAAM;;QAGd,eAAa;OAEZK;AAGb"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CmsCompareEntryRevisionsPresenter } from "./abstractions.js";
|
|
3
|
+
interface CmsCompareEntryRevisionsDrawerProps {
|
|
4
|
+
presenter: CmsCompareEntryRevisionsPresenter.Interface;
|
|
5
|
+
}
|
|
6
|
+
export declare const CmsCompareEntryRevisionsDrawer: (({ presenter }: CmsCompareEntryRevisionsDrawerProps) => React.JSX.Element) & React.NamedExoticComponent<CmsCompareEntryRevisionsDrawerProps> & {
|
|
7
|
+
readonly type: ({ presenter }: CmsCompareEntryRevisionsDrawerProps) => React.JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { createReactiveComponent } from "@webiny/app-admin";
|
|
3
|
+
import { Button, Checkbox, Drawer, List, Text } from "@webiny/admin-ui";
|
|
4
|
+
import { useContentEntryFormPresenter } from "@webiny/app-headless-cms/exports/admin/cms/entry/editor.js";
|
|
5
|
+
const DateDisplay = ({ date })=>{
|
|
6
|
+
const formatted = react.useMemo(()=>{
|
|
7
|
+
const d = new globalThis.Date(date);
|
|
8
|
+
if (isNaN(d.getTime())) return "";
|
|
9
|
+
return new Intl.DateTimeFormat(navigator.language, {
|
|
10
|
+
day: "numeric",
|
|
11
|
+
month: "long",
|
|
12
|
+
year: "numeric"
|
|
13
|
+
}).format(d);
|
|
14
|
+
}, [
|
|
15
|
+
date
|
|
16
|
+
]);
|
|
17
|
+
return /*#__PURE__*/ react.createElement(react.Fragment, null, formatted);
|
|
18
|
+
};
|
|
19
|
+
const CmsCompareEntryRevisionsDrawer = createReactiveComponent(({ presenter })=>{
|
|
20
|
+
const formPresenter = useContentEntryFormPresenter();
|
|
21
|
+
const { revisions, selectedIds, canCompare, drawerVisible } = presenter.vm;
|
|
22
|
+
const modelId = formPresenter.vm.model.modelId;
|
|
23
|
+
return /*#__PURE__*/ react.createElement(Drawer, {
|
|
24
|
+
title: "Compare entry revisions",
|
|
25
|
+
description: "Select two revisions to compare their content using AI",
|
|
26
|
+
open: drawerVisible,
|
|
27
|
+
onOpenChange: (open)=>{
|
|
28
|
+
if (!open) presenter.hideDrawer();
|
|
29
|
+
},
|
|
30
|
+
modal: true,
|
|
31
|
+
bodyPadding: false,
|
|
32
|
+
headerSeparator: true,
|
|
33
|
+
width: 800,
|
|
34
|
+
actions: /*#__PURE__*/ react.createElement(Button, {
|
|
35
|
+
variant: "primary",
|
|
36
|
+
disabled: !canCompare,
|
|
37
|
+
onClick: ()=>presenter.compare(modelId),
|
|
38
|
+
text: canCompare ? "Compare" : `Select ${2 - selectedIds.length} revision${1 === selectedIds.length ? "" : "s"}`,
|
|
39
|
+
"data-testid": "cms.compare-revisions.compare-button"
|
|
40
|
+
})
|
|
41
|
+
}, revisions.length > 0 ? /*#__PURE__*/ react.createElement(List, {
|
|
42
|
+
"data-testid": "cms.compare-revisions.list"
|
|
43
|
+
}, revisions.map((revision)=>{
|
|
44
|
+
const isSelected = selectedIds.includes(revision.id);
|
|
45
|
+
const isDisabled = selectedIds.length >= 2 && !isSelected;
|
|
46
|
+
return /*#__PURE__*/ react.createElement(List.Item, {
|
|
47
|
+
key: revision.id,
|
|
48
|
+
icon: /*#__PURE__*/ react.createElement("div", {
|
|
49
|
+
onClick: (e)=>e.stopPropagation()
|
|
50
|
+
}, /*#__PURE__*/ react.createElement(Checkbox, {
|
|
51
|
+
checked: isSelected,
|
|
52
|
+
onChange: ()=>presenter.toggleRevision(revision.id),
|
|
53
|
+
disabled: isDisabled,
|
|
54
|
+
"data-testid": `cms.compare-revisions.select-${revision.meta.version}`
|
|
55
|
+
})),
|
|
56
|
+
title: revision.meta.title || "N/A",
|
|
57
|
+
description: /*#__PURE__*/ react.createElement(Text, {
|
|
58
|
+
as: "div",
|
|
59
|
+
size: "sm"
|
|
60
|
+
}, "Last modified by", " ", revision.revisionCreatedBy ? revision.revisionCreatedBy.displayName : "Unknown", " ", "on ", /*#__PURE__*/ react.createElement(DateDisplay, {
|
|
61
|
+
date: revision.revisionSavedOn
|
|
62
|
+
}), " (#", revision.meta.version, ")"),
|
|
63
|
+
onClick: ()=>presenter.toggleRevision(revision.id),
|
|
64
|
+
"data-testid": `cms.compare-revisions.item-${revision.meta.version}`
|
|
65
|
+
});
|
|
66
|
+
})) : /*#__PURE__*/ react.createElement("div", {
|
|
67
|
+
className: "p-lg"
|
|
68
|
+
}, "No revisions to compare."));
|
|
69
|
+
});
|
|
70
|
+
export { CmsCompareEntryRevisionsDrawer };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=CmsCompareEntryRevisionsDrawer.js.map
|