@webiny/ai-powerups 6.4.12-beta.4 → 6.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/admin/Extension.js +7 -1
  2. package/admin/Extension.js.map +1 -1
  3. package/admin/domain/modelRoles.d.ts +17 -0
  4. package/admin/domain/modelRoles.js +8 -0
  5. package/admin/domain/modelRoles.js.map +1 -0
  6. package/admin/features/compareEntryRevisions/CompareEntryRevisionsGateway.d.ts +12 -0
  7. package/admin/features/compareEntryRevisions/CompareEntryRevisionsGateway.js +46 -0
  8. package/admin/features/compareEntryRevisions/CompareEntryRevisionsGateway.js.map +1 -0
  9. package/admin/features/compareEntryRevisions/CompareEntryRevisionsRepository.d.ts +11 -0
  10. package/admin/features/compareEntryRevisions/CompareEntryRevisionsRepository.js +18 -0
  11. package/admin/features/compareEntryRevisions/CompareEntryRevisionsRepository.js.map +1 -0
  12. package/admin/features/compareEntryRevisions/CompareEntryRevisionsUseCase.d.ts +11 -0
  13. package/admin/features/compareEntryRevisions/CompareEntryRevisionsUseCase.js +18 -0
  14. package/admin/features/compareEntryRevisions/CompareEntryRevisionsUseCase.js.map +1 -0
  15. package/admin/features/compareEntryRevisions/abstractions.d.ts +32 -0
  16. package/admin/features/compareEntryRevisions/abstractions.js +7 -0
  17. package/admin/features/compareEntryRevisions/abstractions.js.map +1 -0
  18. package/admin/features/compareEntryRevisions/feature.d.ts +1 -0
  19. package/admin/features/compareEntryRevisions/feature.js +15 -0
  20. package/admin/features/compareEntryRevisions/feature.js.map +1 -0
  21. package/admin/features/compareEntryRevisions/index.d.ts +2 -0
  22. package/admin/features/compareEntryRevisions/index.js +2 -0
  23. package/admin/features/feature.js +4 -0
  24. package/admin/features/feature.js.map +1 -1
  25. package/admin/features/generateEntryContent/GenerateEntryContentGateway.d.ts +12 -0
  26. package/admin/features/generateEntryContent/GenerateEntryContentGateway.js +45 -0
  27. package/admin/features/generateEntryContent/GenerateEntryContentGateway.js.map +1 -0
  28. package/admin/features/generateEntryContent/GenerateEntryContentUseCase.d.ts +11 -0
  29. package/admin/features/generateEntryContent/GenerateEntryContentUseCase.js +18 -0
  30. package/admin/features/generateEntryContent/GenerateEntryContentUseCase.js.map +1 -0
  31. package/admin/features/generateEntryContent/abstractions.d.ts +24 -0
  32. package/admin/features/generateEntryContent/abstractions.js +6 -0
  33. package/admin/features/generateEntryContent/abstractions.js.map +1 -0
  34. package/admin/features/generateEntryContent/feature.d.ts +1 -0
  35. package/admin/features/generateEntryContent/feature.js +13 -0
  36. package/admin/features/generateEntryContent/feature.js.map +1 -0
  37. package/admin/features/generateEntryContent/index.d.ts +3 -0
  38. package/admin/features/generateEntryContent/index.js +2 -0
  39. package/admin/features/generatePageContent/GeneratePageContentGateway.js +2 -0
  40. package/admin/features/generatePageContent/GeneratePageContentGateway.js.map +1 -1
  41. package/admin/features/generatePageContent/abstractions.d.ts +1 -0
  42. package/admin/features/generatePageContent/abstractions.js.map +1 -1
  43. package/admin/features/listCapabilities/ListCapabilitiesGateway.d.ts +12 -0
  44. package/admin/features/listCapabilities/ListCapabilitiesGateway.js +34 -0
  45. package/admin/features/listCapabilities/ListCapabilitiesGateway.js.map +1 -0
  46. package/admin/features/listCapabilities/ListCapabilitiesRepository.d.ts +13 -0
  47. package/admin/features/listCapabilities/ListCapabilitiesRepository.js +27 -0
  48. package/admin/features/listCapabilities/ListCapabilitiesRepository.js.map +1 -0
  49. package/admin/features/listCapabilities/ListCapabilitiesUseCase.d.ts +10 -0
  50. package/admin/features/listCapabilities/ListCapabilitiesUseCase.js +18 -0
  51. package/admin/features/listCapabilities/ListCapabilitiesUseCase.js.map +1 -0
  52. package/admin/features/listCapabilities/abstractions.d.ts +28 -0
  53. package/admin/features/listCapabilities/abstractions.js +7 -0
  54. package/admin/features/listCapabilities/abstractions.js.map +1 -0
  55. package/admin/features/listCapabilities/feature.d.ts +3 -0
  56. package/admin/features/listCapabilities/feature.js +21 -0
  57. package/admin/features/listCapabilities/feature.js.map +1 -0
  58. package/admin/features/listCapabilities/index.d.ts +3 -0
  59. package/admin/features/listCapabilities/index.js +2 -0
  60. package/admin/features/listModels/ListModelsGateway.js +18 -1
  61. package/admin/features/listModels/ListModelsGateway.js.map +1 -1
  62. package/admin/features/listModels/abstractions.d.ts +2 -0
  63. package/admin/features/listModels/abstractions.js.map +1 -1
  64. package/admin/features/settings/shared/abstractions.d.ts +58 -25
  65. package/admin/features/settings/shared/abstractions.js.map +1 -1
  66. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.d.ts +2 -2
  67. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js +3 -4
  68. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js.map +1 -1
  69. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.js +13 -1
  70. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.js.map +1 -1
  71. package/admin/presentation/AiPowerUpsSettings/feature.js +6 -2
  72. package/admin/presentation/AiPowerUpsSettings/feature.js.map +1 -1
  73. package/admin/presentation/AiPowerUpsSettings/hasUsableModel.d.ts +13 -0
  74. package/admin/presentation/AiPowerUpsSettings/hasUsableModel.js +9 -0
  75. package/admin/presentation/AiPowerUpsSettings/hasUsableModel.js.map +1 -0
  76. package/admin/presentation/AiPowerUpsSettings/index.d.ts +1 -0
  77. package/admin/presentation/AiPowerUpsSettings/index.js +1 -0
  78. package/admin/presentation/AiPowerUpsSettings/settingsGroup.d.ts +6 -0
  79. package/admin/presentation/AiPowerUpsSettings/settingsGroup.js.map +1 -1
  80. package/admin/presentation/AiPromptFormFactory/AiPromptFormFactory.d.ts +20 -0
  81. package/admin/presentation/AiPromptFormFactory/AiPromptFormFactory.js +108 -0
  82. package/admin/presentation/AiPromptFormFactory/AiPromptFormFactory.js.map +1 -0
  83. package/admin/presentation/AiPromptFormFactory/abstractions.d.ts +14 -0
  84. package/admin/presentation/AiPromptFormFactory/abstractions.js +5 -0
  85. package/admin/presentation/AiPromptFormFactory/abstractions.js.map +1 -0
  86. package/admin/presentation/AiPromptFormFactory/feature.d.ts +1 -0
  87. package/admin/presentation/AiPromptFormFactory/feature.js +11 -0
  88. package/admin/presentation/AiPromptFormFactory/feature.js.map +1 -0
  89. package/admin/presentation/CapabilitiesSettings.d.ts +39 -0
  90. package/admin/presentation/CapabilitiesSettings.js +104 -0
  91. package/admin/presentation/CapabilitiesSettings.js.map +1 -0
  92. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDialog.d.ts +9 -0
  93. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDialog.js +118 -0
  94. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDialog.js.map +1 -0
  95. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDrawer.d.ts +9 -0
  96. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDrawer.js +72 -0
  97. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsDrawer.js.map +1 -0
  98. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsMenuItem.d.ts +4 -0
  99. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsMenuItem.js +21 -0
  100. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsMenuItem.js.map +1 -0
  101. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsOverlays.d.ts +2 -0
  102. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsOverlays.js +17 -0
  103. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsOverlays.js.map +1 -0
  104. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsPresenter.d.ts +25 -0
  105. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsPresenter.js +90 -0
  106. package/admin/presentation/CmsCompareEntryRevisions/CmsCompareEntryRevisionsPresenter.js.map +1 -0
  107. package/admin/presentation/CmsCompareEntryRevisions/Extension.d.ts +2 -0
  108. package/admin/presentation/CmsCompareEntryRevisions/Extension.js +16 -0
  109. package/admin/presentation/CmsCompareEntryRevisions/Extension.js.map +1 -0
  110. package/admin/presentation/CmsCompareEntryRevisions/abstractions.d.ts +29 -0
  111. package/admin/presentation/CmsCompareEntryRevisions/abstractions.js +5 -0
  112. package/admin/presentation/CmsCompareEntryRevisions/abstractions.js.map +1 -0
  113. package/admin/presentation/CmsCompareEntryRevisions/feature.d.ts +3 -0
  114. package/admin/presentation/CmsCompareEntryRevisions/feature.js +17 -0
  115. package/admin/presentation/CmsCompareEntryRevisions/feature.js.map +1 -0
  116. package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.d.ts +4 -0
  117. package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.js +27 -0
  118. package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.js.map +1 -0
  119. package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.d.ts +5 -0
  120. package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.js +106 -0
  121. package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.js.map +1 -0
  122. package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.d.ts +29 -0
  123. package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.js +120 -0
  124. package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.js.map +1 -0
  125. package/admin/presentation/CmsContentGeneration/Extension.d.ts +2 -0
  126. package/admin/presentation/CmsContentGeneration/Extension.js +27 -0
  127. package/admin/presentation/CmsContentGeneration/Extension.js.map +1 -0
  128. package/admin/presentation/CmsContentGeneration/abstractions.d.ts +20 -0
  129. package/admin/presentation/CmsContentGeneration/abstractions.js +5 -0
  130. package/admin/presentation/CmsContentGeneration/abstractions.js.map +1 -0
  131. package/admin/presentation/CmsContentGeneration/feature.d.ts +3 -0
  132. package/admin/presentation/CmsContentGeneration/feature.js +17 -0
  133. package/admin/presentation/CmsContentGeneration/feature.js.map +1 -0
  134. package/admin/presentation/CmsEntryWizard/CmsEntryWizard.d.ts +4 -0
  135. package/admin/presentation/CmsEntryWizard/CmsEntryWizard.js +113 -0
  136. package/admin/presentation/CmsEntryWizard/CmsEntryWizard.js.map +1 -0
  137. package/admin/presentation/CmsEntryWizard/CmsEntryWizardGate.d.ts +4 -0
  138. package/admin/presentation/CmsEntryWizard/CmsEntryWizardGate.js +19 -0
  139. package/admin/presentation/CmsEntryWizard/CmsEntryWizardGate.js.map +1 -0
  140. package/admin/presentation/CmsEntryWizard/Extension.d.ts +2 -0
  141. package/admin/presentation/CmsEntryWizard/Extension.js +10 -0
  142. package/admin/presentation/CmsEntryWizard/Extension.js.map +1 -0
  143. package/admin/presentation/ConnectionsSettings.d.ts +25 -0
  144. package/admin/presentation/ConnectionsSettings.js +52 -0
  145. package/admin/presentation/ConnectionsSettings.js.map +1 -0
  146. package/admin/presentation/ModelRolesSettings.d.ts +29 -0
  147. package/admin/presentation/ModelRolesSettings.js +67 -0
  148. package/admin/presentation/ModelRolesSettings.js.map +1 -0
  149. package/admin/presentation/ProjectsSettings.js +4 -4
  150. package/admin/presentation/ProjectsSettings.js.map +1 -1
  151. package/admin/presentation/ProvidersSettings.js +1 -1
  152. package/admin/presentation/ProvidersSettings.js.map +1 -1
  153. package/admin/presentation/WbContentGeneration/GenerateContentButton.js +2 -2
  154. package/admin/presentation/WbContentGeneration/GenerateContentButton.js.map +1 -1
  155. package/admin/presentation/WbContentGeneration/GenerateContentDialog.d.ts +2 -2
  156. package/admin/presentation/WbContentGeneration/GenerateContentDialog.js +2 -2
  157. package/admin/presentation/WbContentGeneration/GenerateContentDialog.js.map +1 -1
  158. package/admin/presentation/WbContentGeneration/GenerateContentPresenter.d.ts +4 -12
  159. package/admin/presentation/WbContentGeneration/GenerateContentPresenter.js +12 -94
  160. package/admin/presentation/WbContentGeneration/GenerateContentPresenter.js.map +1 -1
  161. package/admin/presentation/modelRoles.d.ts +10 -0
  162. package/admin/presentation/modelRoles.js +23 -0
  163. package/admin/presentation/modelRoles.js.map +1 -0
  164. package/api/Extension.js +16 -0
  165. package/api/Extension.js.map +1 -1
  166. package/api/features/AiImageEnrichment/AiImageEnrichmentTask.d.ts +10 -8
  167. package/api/features/AiImageEnrichment/AiImageEnrichmentTask.js +37 -42
  168. package/api/features/AiImageEnrichment/AiImageEnrichmentTask.js.map +1 -1
  169. package/api/features/AiImageEnrichment/capability.d.ts +13 -0
  170. package/api/features/AiImageEnrichment/capability.js +19 -0
  171. package/api/features/AiImageEnrichment/capability.js.map +1 -0
  172. package/api/features/AiImageEnrichment/feature.js +2 -0
  173. package/api/features/AiImageEnrichment/feature.js.map +1 -1
  174. package/api/features/AiPromptContext/AiPromptContextBuilder.d.ts +8 -1
  175. package/api/features/AiPromptContext/AiPromptContextBuilder.js +46 -2
  176. package/api/features/AiPromptContext/AiPromptContextBuilder.js.map +1 -1
  177. package/api/features/AiPromptContext/abstractions.d.ts +3 -0
  178. package/api/features/AiPromptContext/abstractions.js +9 -1
  179. package/api/features/AiPromptContext/abstractions.js.map +1 -1
  180. package/api/features/AiPromptContext/index.d.ts +1 -1
  181. package/api/features/AiPromptContext/index.js +1 -1
  182. package/api/features/Capabilities/CapabilitiesHandler.d.ts +28 -0
  183. package/api/features/Capabilities/CapabilitiesHandler.js +56 -0
  184. package/api/features/Capabilities/CapabilitiesHandler.js.map +1 -0
  185. package/api/features/Capabilities/ListAiCapabilitiesUseCase.d.ts +18 -0
  186. package/api/features/Capabilities/ListAiCapabilitiesUseCase.js +28 -0
  187. package/api/features/Capabilities/ListAiCapabilitiesUseCase.js.map +1 -0
  188. package/api/features/Capabilities/ResolveAiCapabilityUseCase.d.ts +30 -0
  189. package/api/features/Capabilities/ResolveAiCapabilityUseCase.js +88 -0
  190. package/api/features/Capabilities/ResolveAiCapabilityUseCase.js.map +1 -0
  191. package/api/features/Capabilities/abstractions.d.ts +77 -0
  192. package/api/features/Capabilities/abstractions.js +7 -0
  193. package/api/features/Capabilities/abstractions.js.map +1 -0
  194. package/api/features/Capabilities/composeSystemPrompt.d.ts +14 -0
  195. package/api/features/Capabilities/composeSystemPrompt.js +13 -0
  196. package/api/features/Capabilities/composeSystemPrompt.js.map +1 -0
  197. package/api/features/Capabilities/feature.d.ts +4 -0
  198. package/api/features/Capabilities/feature.js +15 -0
  199. package/api/features/Capabilities/feature.js.map +1 -0
  200. package/api/features/Capabilities/index.d.ts +5 -0
  201. package/api/features/Capabilities/index.js +3 -0
  202. package/api/features/Capabilities/types.d.ts +86 -0
  203. package/api/features/Capabilities/types.js +4 -0
  204. package/api/features/Capabilities/types.js.map +1 -0
  205. package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.d.ts +20 -0
  206. package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.js +82 -0
  207. package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.js.map +1 -0
  208. package/api/features/CmsCompareEntryRevisions/abstractions.d.ts +18 -0
  209. package/api/features/CmsCompareEntryRevisions/abstractions.js +5 -0
  210. package/api/features/CmsCompareEntryRevisions/abstractions.js.map +1 -0
  211. package/api/features/CmsCompareEntryRevisions/capability.d.ts +13 -0
  212. package/api/features/CmsCompareEntryRevisions/capability.js +64 -0
  213. package/api/features/CmsCompareEntryRevisions/capability.js.map +1 -0
  214. package/api/features/CmsCompareEntryRevisions/feature.d.ts +4 -0
  215. package/api/features/CmsCompareEntryRevisions/feature.js +13 -0
  216. package/api/features/CmsCompareEntryRevisions/feature.js.map +1 -0
  217. package/api/features/CmsCompareEntryRevisions/index.d.ts +2 -0
  218. package/api/features/CmsCompareEntryRevisions/index.js +2 -0
  219. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.d.ts +33 -0
  220. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js +84 -0
  221. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js.map +1 -0
  222. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.d.ts +27 -0
  223. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.js +133 -0
  224. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.js.map +1 -0
  225. package/api/features/CmsGenerateEntryContent/abstractions.d.ts +36 -0
  226. package/api/features/CmsGenerateEntryContent/abstractions.js +5 -0
  227. package/api/features/CmsGenerateEntryContent/abstractions.js.map +1 -0
  228. package/api/features/CmsGenerateEntryContent/buildPrompt.d.ts +2 -0
  229. package/api/features/CmsGenerateEntryContent/buildPrompt.js +61 -0
  230. package/api/features/CmsGenerateEntryContent/buildPrompt.js.map +1 -0
  231. package/api/features/CmsGenerateEntryContent/capability.d.ts +17 -0
  232. package/api/features/CmsGenerateEntryContent/capability.js +17 -0
  233. package/api/features/CmsGenerateEntryContent/capability.js.map +1 -0
  234. package/api/features/CmsGenerateEntryContent/feature.d.ts +4 -0
  235. package/api/features/CmsGenerateEntryContent/feature.js +15 -0
  236. package/api/features/CmsGenerateEntryContent/feature.js.map +1 -0
  237. package/api/features/CmsGenerateEntryContent/index.d.ts +1 -0
  238. package/api/features/CmsGenerateEntryContent/index.js +1 -0
  239. package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.d.ts +2 -0
  240. package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.js +30 -0
  241. package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.js.map +1 -0
  242. package/api/features/CmsResolveImageTool/CmsResolveImageTool.d.ts +14 -0
  243. package/api/features/CmsResolveImageTool/CmsResolveImageTool.js +27 -0
  244. package/api/features/CmsResolveImageTool/CmsResolveImageTool.js.map +1 -0
  245. package/api/features/CmsResolveImageTool/feature.d.ts +4 -0
  246. package/api/features/CmsResolveImageTool/feature.js +11 -0
  247. package/api/features/CmsResolveImageTool/feature.js.map +1 -0
  248. package/api/features/Connections/ConnectionsGraphQLMapper.d.ts +20 -0
  249. package/api/features/Connections/ConnectionsGraphQLMapper.js +37 -0
  250. package/api/features/Connections/ConnectionsGraphQLMapper.js.map +1 -0
  251. package/api/features/Connections/ConnectionsHandler.d.ts +25 -0
  252. package/api/features/Connections/ConnectionsHandler.js +84 -0
  253. package/api/features/Connections/ConnectionsHandler.js.map +1 -0
  254. package/api/features/Connections/feature.d.ts +4 -0
  255. package/api/features/Connections/feature.js +13 -0
  256. package/api/features/Connections/feature.js.map +1 -0
  257. package/api/features/Connections/index.d.ts +2 -0
  258. package/api/features/Connections/index.js +1 -0
  259. package/api/features/Connections/legacyProviders.d.ts +26 -0
  260. package/api/features/Connections/legacyProviders.js +9 -0
  261. package/api/features/Connections/legacyProviders.js.map +1 -0
  262. package/api/features/Connections/types.d.ts +36 -0
  263. package/api/features/Connections/types.js +0 -0
  264. package/api/features/GetSettings/GetSettingsRepository.js +1 -1
  265. package/api/features/GetSettings/GetSettingsRepository.js.map +1 -1
  266. package/api/features/GetSettings/index.d.ts +1 -0
  267. package/api/features/GetSettings/index.js +1 -0
  268. package/api/features/ModelRoles/ModelRolesHandler.d.ts +15 -0
  269. package/api/features/ModelRoles/ModelRolesHandler.js +68 -0
  270. package/api/features/ModelRoles/ModelRolesHandler.js.map +1 -0
  271. package/api/features/ModelRoles/feature.d.ts +4 -0
  272. package/api/features/ModelRoles/feature.js +11 -0
  273. package/api/features/ModelRoles/feature.js.map +1 -0
  274. package/api/features/ModelRoles/index.d.ts +4 -0
  275. package/api/features/ModelRoles/index.js +2 -0
  276. package/api/features/ModelRoles/roles.d.ts +16 -0
  277. package/api/features/ModelRoles/roles.js +9 -0
  278. package/api/features/ModelRoles/roles.js.map +1 -0
  279. package/api/features/ModelRoles/types.d.ts +21 -0
  280. package/api/features/ModelRoles/types.js +7 -0
  281. package/api/features/ModelRoles/types.js.map +1 -0
  282. package/api/features/Providers/ProvidersHandler.js.map +1 -1
  283. package/api/features/Providers/types.d.ts +2 -2
  284. package/api/features/UpdateSettings/UpdateSettingsRepository.js +2 -2
  285. package/api/features/UpdateSettings/UpdateSettingsRepository.js.map +1 -1
  286. package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.d.ts +4 -3
  287. package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.js +25 -15
  288. package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.js.map +1 -1
  289. package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.d.ts +3 -5
  290. package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.js +16 -23
  291. package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.js.map +1 -1
  292. package/api/features/WbGeneratePageContent/abstractions.d.ts +1 -0
  293. package/api/features/WbGeneratePageContent/abstractions.js.map +1 -1
  294. package/api/features/WbGeneratePageContent/capability.d.ts +16 -0
  295. package/api/features/WbGeneratePageContent/capability.js +17 -0
  296. package/api/features/WbGeneratePageContent/capability.js.map +1 -0
  297. package/api/features/WbGeneratePageContent/feature.js +2 -0
  298. package/api/features/WbGeneratePageContent/feature.js.map +1 -1
  299. package/api/features/WbTranslatePage/LexicalParser.d.ts +10 -0
  300. package/api/features/WbTranslatePage/LexicalParser.js +37 -0
  301. package/api/features/WbTranslatePage/LexicalParser.js.map +1 -0
  302. package/api/features/WbTranslatePage/WbTranslatePageDecorator.d.ts +29 -0
  303. package/api/features/WbTranslatePage/WbTranslatePageDecorator.js +143 -0
  304. package/api/features/WbTranslatePage/WbTranslatePageDecorator.js.map +1 -0
  305. package/api/features/WbTranslatePage/abstractions/LexicalParser.d.ts +7 -0
  306. package/api/features/WbTranslatePage/abstractions/LexicalParser.js +5 -0
  307. package/api/features/WbTranslatePage/abstractions/LexicalParser.js.map +1 -0
  308. package/api/features/WbTranslatePage/capability.d.ts +13 -0
  309. package/api/features/WbTranslatePage/capability.js +19 -0
  310. package/api/features/WbTranslatePage/capability.js.map +1 -0
  311. package/api/features/WbTranslatePage/feature.d.ts +4 -0
  312. package/api/features/WbTranslatePage/feature.js +15 -0
  313. package/api/features/WbTranslatePage/feature.js.map +1 -0
  314. package/api/features/WbTranslatePage/index.d.ts +2 -0
  315. package/api/features/WbTranslatePage/index.js +2 -0
  316. package/api/features/shared/abstractions.d.ts +6 -1
  317. package/api/features/shared/abstractions.js.map +1 -1
  318. package/api/features/shared/modelId.d.ts +11 -0
  319. package/api/features/shared/modelId.js +4 -0
  320. package/api/features/shared/modelId.js.map +1 -0
  321. package/api/graphql/BaseGraphQLSchema.js +58 -1
  322. package/api/graphql/BaseGraphQLSchema.js.map +1 -1
  323. package/api/graphql/CmsCompareEntryRevisionsSchema.d.ts +8 -0
  324. package/api/graphql/CmsCompareEntryRevisionsSchema.js +68 -0
  325. package/api/graphql/CmsCompareEntryRevisionsSchema.js.map +1 -0
  326. package/api/types.d.ts +3 -0
  327. package/api/types.js +3 -0
  328. package/{api/features/WbGeneratePageContent → domain}/LlmJsonResponse.d.ts +1 -0
  329. package/{api/features/WbGeneratePageContent → domain}/LlmJsonResponse.js +3 -0
  330. package/domain/LlmJsonResponse.js.map +1 -0
  331. package/exports/admin/ai-powerups.d.ts +1 -0
  332. package/exports/admin/ai-powerups.js +1 -0
  333. package/exports/api/ai-powerups.d.ts +2 -0
  334. package/exports/api/ai-powerups.js +2 -0
  335. package/package.json +33 -26
  336. package/api/features/WbGeneratePageContent/LlmJsonResponse.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/CmsGenerateEntryContent/abstractions.js","sources":["../../../../src/api/features/CmsGenerateEntryContent/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\n\nexport interface CmsGenerateEntryContentParams {\n prompt: string;\n modelId: string;\n projectId?: string | null;\n excludedFileIds?: string[] | null;\n readerPersonaId?: string | null;\n writerPersonaId?: string | null;\n additionalFileIds?: string[] | null;\n}\n\nexport interface GenerateEntryContentTelemetry {\n filesRead: string[];\n cacheHit: boolean;\n toolCallsMade: number;\n totalSteps: number;\n toolsAvailable: string[];\n imageTagsInPrompt: string[];\n}\n\nexport interface GenerateEntryContentResult<TValues = Record<string, any>> {\n /**\n * The generated entry values, keyed by fieldId. Callers that consume the result\n * directly (e.g. a bulk action) can read fields straight off this object; transport\n * edges (the background task / websocket stream) serialize it themselves. Pass a type\n * argument to `execute` to shape this (e.g. `execute<{ aiSummary?: string }>`).\n */\n values: TValues;\n telemetry: GenerateEntryContentTelemetry;\n}\n\nexport interface ICmsGenerateEntryContentUseCase {\n execute<TValues = Record<string, any>>(\n params: CmsGenerateEntryContentParams\n ): Promise<Result<GenerateEntryContentResult<TValues>, Error>>;\n}\n\nexport const CmsGenerateEntryContentUseCase = createAbstraction<ICmsGenerateEntryContentUseCase>(\n \"AiPowerUpsCmsGenerateEntryContentUseCase\"\n);\n\nexport namespace CmsGenerateEntryContentUseCase {\n export type Interface = ICmsGenerateEntryContentUseCase;\n export type Params = CmsGenerateEntryContentParams;\n}\n"],"names":["CmsGenerateEntryContentUseCase","createAbstraction"],"mappings":";AAsCO,MAAMA,iCAAiCC,kBAC1C"}
@@ -0,0 +1,2 @@
1
+ import type { JsonSchema } from "@webiny/api-headless-cms/utils/contentModelToJsonSchema/types.js";
2
+ export declare function buildEntryPrompt(modelName: string, entrySchema: JsonSchema, availableImageTags: string[]): string;
@@ -0,0 +1,61 @@
1
+ function buildEntryPrompt(modelName, entrySchema, availableImageTags) {
2
+ const tagListing = availableImageTags.length > 0 ? availableImageTags.map((t)=>`\`${t}\``).join(", ") : "(no image tags available in the File Manager — image fields should be left empty or omitted)";
3
+ return `You are a CMS content entry generator. Given a user prompt, generate structured content for a "${modelName}" entry using the JSON Schema below.
4
+
5
+ ### Rich Text Content
6
+
7
+ For rich text fields, wrap the value in a tool envelope:
8
+ \`\`\`json
9
+ { "tool": "textToLexical", "params": { "text": "<html content>" } }
10
+ \`\`\`
11
+
12
+ Write the content as semantic HTML: use <h1>-<h6>, <p>, <strong>, <em>, <ul>, <ol>, <li>, <a>, <blockquote>.
13
+ A single rich text field CAN contain an entire article with all headings, paragraphs, lists, and blockquotes.
14
+
15
+ ### Image Selection
16
+
17
+ You MUST call the \`listImagesByTag\` tool BEFORE using any image ID.
18
+ Do NOT invent image IDs. Any ID not returned by \`listImagesByTag\` will fail to resolve.
19
+
20
+ The File Manager currently has images tagged with: ${tagListing}.
21
+
22
+ When a field needs an image:
23
+ 1. Pick the tag from the list above that best matches the content topic.
24
+ 2. Call \`listImagesByTag\` with that tag.
25
+ 3. If results are non-empty, wrap the image reference in a tool envelope:
26
+ \`{ "tool": "cmsResolveImage", "params": { "id": "<image_id_from_search>" } }\`
27
+ 4. If results are empty, try one more tag. If still nothing, leave the field empty.
28
+
29
+ ### File Fields
30
+
31
+ For file/image fields, always use the \`cmsResolveImage\` tool envelope with an ID obtained from \`listImagesByTag\`:
32
+ \`{ "tool": "cmsResolveImage", "params": { "id": "<file_id>" } }\`
33
+
34
+ ### Reference Fields
35
+
36
+ Reference fields expect \`{ "entryId": "<id>", "modelId": "<model>" }\`. If you don't have real entry IDs, leave reference fields empty or use placeholder values.
37
+
38
+ ### SEO & Content Best Practices
39
+
40
+ - Use exactly ONE <h1> per rich text field as the main title.
41
+ - Use <h2> for sections, <h3> for subsections. Never skip heading levels.
42
+ - Keep paragraphs short — 2 to 4 sentences.
43
+ - Lead with the most important information first.
44
+ - Incorporate topic keywords naturally without stuffing.
45
+
46
+ ### Entry Schema
47
+
48
+ The entry must conform to this JSON Schema:
49
+
50
+ \`\`\`json
51
+ ${JSON.stringify(entrySchema, null, 2)}
52
+ \`\`\`
53
+
54
+ You MUST generate the full entry content as JSON after using any tools.
55
+ Tool calls are for gathering information — your final response must always be the complete entry JSON object.
56
+
57
+ IMPORTANT: You MUST return a parsable JSON object conforming to the schema above. No extra text outside the JSON.`;
58
+ }
59
+ export { buildEntryPrompt };
60
+
61
+ //# sourceMappingURL=buildPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/CmsGenerateEntryContent/buildPrompt.js","sources":["../../../../src/api/features/CmsGenerateEntryContent/buildPrompt.ts"],"sourcesContent":["import type { JsonSchema } from \"@webiny/api-headless-cms/utils/contentModelToJsonSchema/types.js\";\n\nexport function buildEntryPrompt(\n modelName: string,\n entrySchema: JsonSchema,\n availableImageTags: string[]\n): string {\n const tagListing =\n availableImageTags.length > 0\n ? availableImageTags.map(t => `\\`${t}\\``).join(\", \")\n : \"(no image tags available in the File Manager — image fields should be left empty or omitted)\";\n\n return `You are a CMS content entry generator. Given a user prompt, generate structured content for a \"${modelName}\" entry using the JSON Schema below.\n\n### Rich Text Content\n\nFor rich text fields, wrap the value in a tool envelope:\n\\`\\`\\`json\n{ \"tool\": \"textToLexical\", \"params\": { \"text\": \"<html content>\" } }\n\\`\\`\\`\n\nWrite the content as semantic HTML: use <h1>-<h6>, <p>, <strong>, <em>, <ul>, <ol>, <li>, <a>, <blockquote>.\nA single rich text field CAN contain an entire article with all headings, paragraphs, lists, and blockquotes.\n\n### Image Selection\n\nYou MUST call the \\`listImagesByTag\\` tool BEFORE using any image ID.\nDo NOT invent image IDs. Any ID not returned by \\`listImagesByTag\\` will fail to resolve.\n\nThe File Manager currently has images tagged with: ${tagListing}.\n\nWhen a field needs an image:\n1. Pick the tag from the list above that best matches the content topic.\n2. Call \\`listImagesByTag\\` with that tag.\n3. If results are non-empty, wrap the image reference in a tool envelope:\n \\`{ \"tool\": \"cmsResolveImage\", \"params\": { \"id\": \"<image_id_from_search>\" } }\\`\n4. If results are empty, try one more tag. If still nothing, leave the field empty.\n\n### File Fields\n\nFor file/image fields, always use the \\`cmsResolveImage\\` tool envelope with an ID obtained from \\`listImagesByTag\\`:\n\\`{ \"tool\": \"cmsResolveImage\", \"params\": { \"id\": \"<file_id>\" } }\\`\n\n### Reference Fields\n\nReference fields expect \\`{ \"entryId\": \"<id>\", \"modelId\": \"<model>\" }\\`. If you don't have real entry IDs, leave reference fields empty or use placeholder values.\n\n### SEO & Content Best Practices\n\n- Use exactly ONE <h1> per rich text field as the main title.\n- Use <h2> for sections, <h3> for subsections. Never skip heading levels.\n- Keep paragraphs short — 2 to 4 sentences.\n- Lead with the most important information first.\n- Incorporate topic keywords naturally without stuffing.\n\n### Entry Schema\n\nThe entry must conform to this JSON Schema:\n\n\\`\\`\\`json\n${JSON.stringify(entrySchema, null, 2)}\n\\`\\`\\`\n\nYou MUST generate the full entry content as JSON after using any tools.\nTool calls are for gathering information — your final response must always be the complete entry JSON object.\n\nIMPORTANT: You MUST return a parsable JSON object conforming to the schema above. No extra text outside the JSON.`;\n}\n"],"names":["buildEntryPrompt","modelName","entrySchema","availableImageTags","tagListing","t","JSON"],"mappings":"AAEO,SAASA,iBACZC,SAAiB,EACjBC,WAAuB,EACvBC,kBAA4B;IAE5B,MAAMC,aACFD,mBAAmB,MAAM,GAAG,IACtBA,mBAAmB,GAAG,CAACE,CAAAA,IAAK,CAAC,EAAE,EAAEA,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,QAC7C;IAEV,OAAO,CAAC,+FAA+F,EAAEJ,UAAU;;;;;;;;;;;;;;;;;mDAiBpE,EAAEG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BhE,EAAEE,KAAK,SAAS,CAACJ,aAAa,MAAM,GAAG;;;;;;iHAM0E,CAAC;AAClH"}
@@ -0,0 +1,17 @@
1
+ import { AiCapability } from "../../../api/features/Capabilities/index.js";
2
+ export declare const CMS_GENERATE_ENTRY_CAPABILITY = "cms.generateEntry";
3
+ /**
4
+ * No `guidance`: this prompt is rebuilt on every request from the content model's JSON Schema and
5
+ * the File Manager's current image tags, so there is no fixed block a project could replace without
6
+ * dropping the schema the output has to conform to. Additional instructions still apply.
7
+ */
8
+ declare class CmsGenerateEntryCapabilityImpl implements AiCapability.Interface {
9
+ readonly id = "cms.generateEntry";
10
+ readonly label = "CMS entry generation";
11
+ readonly description = "Writes a content entry from a prompt, following the content model's schema and picking images from the File Manager.";
12
+ readonly defaultRole: "standard";
13
+ }
14
+ export declare const CmsGenerateEntryCapability: typeof CmsGenerateEntryCapabilityImpl & {
15
+ __abstraction: import("@webiny/di").Abstraction<import("~/api/features/Capabilities/index.js").IAiCapability>;
16
+ };
17
+ export {};
@@ -0,0 +1,17 @@
1
+ import { AiCapability } from "../Capabilities/index.js";
2
+ const CMS_GENERATE_ENTRY_CAPABILITY = "cms.generateEntry";
3
+ class CmsGenerateEntryCapabilityImpl {
4
+ constructor(){
5
+ this.id = CMS_GENERATE_ENTRY_CAPABILITY;
6
+ this.label = "CMS entry generation";
7
+ this.description = "Writes a content entry from a prompt, following the content model's schema and picking images from the File Manager.";
8
+ this.defaultRole = "standard";
9
+ }
10
+ }
11
+ const CmsGenerateEntryCapability = AiCapability.createImplementation({
12
+ implementation: CmsGenerateEntryCapabilityImpl,
13
+ dependencies: []
14
+ });
15
+ export { CMS_GENERATE_ENTRY_CAPABILITY, CmsGenerateEntryCapability };
16
+
17
+ //# sourceMappingURL=capability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/CmsGenerateEntryContent/capability.js","sources":["../../../../src/api/features/CmsGenerateEntryContent/capability.ts"],"sourcesContent":["import { AiCapability } from \"~/api/features/Capabilities/index.js\";\n\nexport const CMS_GENERATE_ENTRY_CAPABILITY = \"cms.generateEntry\";\n\n/**\n * No `guidance`: this prompt is rebuilt on every request from the content model's JSON Schema and\n * the File Manager's current image tags, so there is no fixed block a project could replace without\n * dropping the schema the output has to conform to. Additional instructions still apply.\n */\nclass CmsGenerateEntryCapabilityImpl implements AiCapability.Interface {\n readonly id = CMS_GENERATE_ENTRY_CAPABILITY;\n readonly label = \"CMS entry generation\";\n readonly description =\n \"Writes a content entry from a prompt, following the content model's schema and picking images from the File Manager.\";\n readonly defaultRole = \"standard\" as const;\n}\n\nexport const CmsGenerateEntryCapability = AiCapability.createImplementation({\n implementation: CmsGenerateEntryCapabilityImpl,\n dependencies: []\n});\n"],"names":["CMS_GENERATE_ENTRY_CAPABILITY","CmsGenerateEntryCapabilityImpl","CmsGenerateEntryCapability","AiCapability"],"mappings":";AAEO,MAAMA,gCAAgC;AAO7C,MAAMC;;aACO,EAAE,GAAGD;aACL,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAG;;AAC3B;AAEO,MAAME,6BAA6BC,aAAa,oBAAoB,CAAC;IACxE,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,4 @@
1
+ export declare const CmsGenerateEntryContentFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,15 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { CmsGenerateEntryContentUseCaseImplementation } from "./CmsGenerateEntryContentUseCase.js";
3
+ import { CmsGenerateEntryContentTask } from "./CmsGenerateEntryContentTask.js";
4
+ import { CmsGenerateEntryCapability } from "./capability.js";
5
+ const CmsGenerateEntryContentFeature = createFeature({
6
+ name: "AiPowerUps/CmsGenerateEntryContent",
7
+ register (container) {
8
+ container.register(CmsGenerateEntryCapability);
9
+ container.register(CmsGenerateEntryContentUseCaseImplementation);
10
+ container.register(CmsGenerateEntryContentTask);
11
+ }
12
+ });
13
+ export { CmsGenerateEntryContentFeature };
14
+
15
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/CmsGenerateEntryContent/feature.js","sources":["../../../../src/api/features/CmsGenerateEntryContent/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CmsGenerateEntryContentUseCaseImplementation } from \"./CmsGenerateEntryContentUseCase.js\";\nimport { CmsGenerateEntryContentTask } from \"./CmsGenerateEntryContentTask.js\";\nimport { CmsGenerateEntryCapability } from \"./capability.js\";\n\nexport const CmsGenerateEntryContentFeature = createFeature({\n name: \"AiPowerUps/CmsGenerateEntryContent\",\n register(container) {\n container.register(CmsGenerateEntryCapability);\n container.register(CmsGenerateEntryContentUseCaseImplementation);\n container.register(CmsGenerateEntryContentTask);\n }\n});\n"],"names":["CmsGenerateEntryContentFeature","createFeature","container","CmsGenerateEntryCapability","CmsGenerateEntryContentUseCaseImplementation","CmsGenerateEntryContentTask"],"mappings":";;;;AAKO,MAAMA,iCAAiCC,cAAc;IACxD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;IACvB;AACJ"}
@@ -0,0 +1 @@
1
+ export { CmsGenerateEntryContentUseCase } from "./abstractions.js";
@@ -0,0 +1 @@
1
+ export { CmsGenerateEntryContentUseCase } from "./abstractions.js";
@@ -0,0 +1,2 @@
1
+ import type { CmsModelAst } from "@webiny/api-headless-cms/types";
2
+ export declare function injectDynamicZoneTypenames(values: Record<string, any>, modelAst: CmsModelAst, singularApiName: string): Promise<void>;
@@ -0,0 +1,30 @@
1
+ import { ContentEntryTraverser } from "@webiny/api-headless-cms/features/contentEntry/ContentEntryTraverser/ContentEntryTraverser.js";
2
+ import { createTypeName } from "@webiny/api-headless-cms/utils/createTypeName.js";
3
+ async function injectDynamicZoneTypenames(values, modelAst, singularApiName) {
4
+ const traverser = new ContentEntryTraverser(modelAst);
5
+ const graphQLTypeMap = new Map();
6
+ graphQLTypeMap.set("", singularApiName);
7
+ await traverser.traverse(values, async ({ field, value, path })=>{
8
+ if ("dynamicZone" !== field.type || null == value) return;
9
+ const pathParts = path.split(".");
10
+ const parentPrefix = pathParts.slice(0, -1).join(".");
11
+ const enclosingType = graphQLTypeMap.get(parentPrefix) || singularApiName;
12
+ const typeName = `${enclosingType}_${createTypeName(field.fieldId)}`;
13
+ const templates = field.settings?.templates || [];
14
+ const items = field.list && Array.isArray(value) ? value : [
15
+ value
16
+ ];
17
+ for(let i = 0; i < items.length; i++){
18
+ const item = items[i];
19
+ if (!item || !item._templateId) continue;
20
+ const template = templates.find((t)=>t.id === item._templateId);
21
+ if (!template) continue;
22
+ item.__typename = `${typeName}_${template.gqlTypeName}`;
23
+ const itemPath = field.list ? `${path}.${i}` : path;
24
+ graphQLTypeMap.set(itemPath, item.__typename);
25
+ }
26
+ });
27
+ }
28
+ export { injectDynamicZoneTypenames };
29
+
30
+ //# sourceMappingURL=injectDynamicZoneTypenames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.js","sources":["../../../../src/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.ts"],"sourcesContent":["import type { CmsModelAst } from \"@webiny/api-headless-cms/types\";\nimport { ContentEntryTraverser } from \"@webiny/api-headless-cms/features/contentEntry/ContentEntryTraverser/ContentEntryTraverser.js\";\nimport { createTypeName } from \"@webiny/api-headless-cms/utils/createTypeName.js\";\n\ninterface DynamicZoneTemplate {\n id: string;\n gqlTypeName: string;\n}\n\nexport async function injectDynamicZoneTypenames(\n values: Record<string, any>,\n modelAst: CmsModelAst,\n singularApiName: string\n): Promise<void> {\n const traverser = new ContentEntryTraverser(modelAst);\n\n const graphQLTypeMap = new Map<string, string>();\n graphQLTypeMap.set(\"\", singularApiName);\n\n await traverser.traverse(values, async ({ field, value, path }) => {\n if (field.type !== \"dynamicZone\" || value == null) {\n return;\n }\n\n const pathParts = path.split(\".\");\n const parentPrefix = pathParts.slice(0, -1).join(\".\");\n const enclosingType = graphQLTypeMap.get(parentPrefix) || singularApiName;\n const typeName = `${enclosingType}_${createTypeName(field.fieldId)}`;\n\n const templates: DynamicZoneTemplate[] = field.settings?.templates || [];\n const items: Record<string, any>[] = field.list && Array.isArray(value) ? value : [value];\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (!item || !item._templateId) {\n continue;\n }\n\n const template = templates.find(t => t.id === item._templateId);\n if (!template) {\n continue;\n }\n\n item.__typename = `${typeName}_${template.gqlTypeName}`;\n\n const itemPath = field.list ? `${path}.${i}` : path;\n graphQLTypeMap.set(itemPath, item.__typename);\n }\n });\n}\n"],"names":["injectDynamicZoneTypenames","values","modelAst","singularApiName","traverser","ContentEntryTraverser","graphQLTypeMap","Map","field","value","path","pathParts","parentPrefix","enclosingType","typeName","createTypeName","templates","items","Array","i","item","template","t","itemPath"],"mappings":";;AASO,eAAeA,2BAClBC,MAA2B,EAC3BC,QAAqB,EACrBC,eAAuB;IAEvB,MAAMC,YAAY,IAAIC,sBAAsBH;IAE5C,MAAMI,iBAAiB,IAAIC;IAC3BD,eAAe,GAAG,CAAC,IAAIH;IAEvB,MAAMC,UAAU,QAAQ,CAACH,QAAQ,OAAO,EAAEO,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAE;QAC1D,IAAIF,AAAe,kBAAfA,MAAM,IAAI,IAAsBC,AAAS,QAATA,OAChC;QAGJ,MAAME,YAAYD,KAAK,KAAK,CAAC;QAC7B,MAAME,eAAeD,UAAU,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;QACjD,MAAME,gBAAgBP,eAAe,GAAG,CAACM,iBAAiBT;QAC1D,MAAMW,WAAW,GAAGD,cAAc,CAAC,EAAEE,eAAeP,MAAM,OAAO,GAAG;QAEpE,MAAMQ,YAAmCR,MAAM,QAAQ,EAAE,aAAa,EAAE;QACxE,MAAMS,QAA+BT,MAAM,IAAI,IAAIU,MAAM,OAAO,CAACT,SAASA,QAAQ;YAACA;SAAM;QAEzF,IAAK,IAAIU,IAAI,GAAGA,IAAIF,MAAM,MAAM,EAAEE,IAAK;YACnC,MAAMC,OAAOH,KAAK,CAACE,EAAE;YACrB,IAAI,CAACC,QAAQ,CAACA,KAAK,WAAW,EAC1B;YAGJ,MAAMC,WAAWL,UAAU,IAAI,CAACM,CAAAA,IAAKA,EAAE,EAAE,KAAKF,KAAK,WAAW;YAC9D,IAAI,CAACC,UACD;YAGJD,KAAK,UAAU,GAAG,GAAGN,SAAS,CAAC,EAAEO,SAAS,WAAW,EAAE;YAEvD,MAAME,WAAWf,MAAM,IAAI,GAAG,GAAGE,KAAK,CAAC,EAAES,GAAG,GAAGT;YAC/CJ,eAAe,GAAG,CAACiB,UAAUH,KAAK,UAAU;QAChD;IACJ;AACJ"}
@@ -0,0 +1,14 @@
1
+ import { AiOutputTool } from "@webiny/api-core/features/ai/index.js";
2
+ import { GetFileUseCase } from "@webiny/api-file-manager/features/file/GetFile/index.js";
3
+ import { FileUrlGenerator } from "@webiny/api-file-manager/features/file/FileUrlGenerator/index.js";
4
+ declare class CmsResolveImageToolImpl implements AiOutputTool.Interface {
5
+ private getFile;
6
+ private urlGenerator;
7
+ readonly name = "cmsResolveImage";
8
+ constructor(getFile: GetFileUseCase.Interface, urlGenerator: FileUrlGenerator.Interface);
9
+ execute(params: Record<string, unknown>): Promise<unknown>;
10
+ }
11
+ export declare const CmsResolveImageTool: typeof CmsResolveImageToolImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/toolPipeline").IAiOutputTool>;
13
+ };
14
+ export {};
@@ -0,0 +1,27 @@
1
+ import { AiOutputTool } from "@webiny/api-core/features/ai/index.js";
2
+ import { GetFileUseCase } from "@webiny/api-file-manager/features/file/GetFile/index.js";
3
+ import { FileUrlGenerator } from "@webiny/api-file-manager/features/file/FileUrlGenerator/index.js";
4
+ class CmsResolveImageToolImpl {
5
+ constructor(getFile, urlGenerator){
6
+ this.getFile = getFile;
7
+ this.urlGenerator = urlGenerator;
8
+ this.name = "cmsResolveImage";
9
+ }
10
+ async execute(params) {
11
+ const id = params.id;
12
+ if ("string" != typeof id || !id) return null;
13
+ const result = await this.getFile.execute(id);
14
+ if (result.isFail()) return null;
15
+ return this.urlGenerator.generateUrl(result.value);
16
+ }
17
+ }
18
+ const CmsResolveImageTool = AiOutputTool.createImplementation({
19
+ implementation: CmsResolveImageToolImpl,
20
+ dependencies: [
21
+ GetFileUseCase,
22
+ FileUrlGenerator
23
+ ]
24
+ });
25
+ export { CmsResolveImageTool };
26
+
27
+ //# sourceMappingURL=CmsResolveImageTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/CmsResolveImageTool/CmsResolveImageTool.js","sources":["../../../../src/api/features/CmsResolveImageTool/CmsResolveImageTool.ts"],"sourcesContent":["import { AiOutputTool } from \"@webiny/api-core/features/ai/index.js\";\nimport { GetFileUseCase } from \"@webiny/api-file-manager/features/file/GetFile/index.js\";\nimport { FileUrlGenerator } from \"@webiny/api-file-manager/features/file/FileUrlGenerator/index.js\";\n\nclass CmsResolveImageToolImpl implements AiOutputTool.Interface {\n readonly name = \"cmsResolveImage\";\n\n constructor(\n private getFile: GetFileUseCase.Interface,\n private urlGenerator: FileUrlGenerator.Interface\n ) {}\n\n async execute(params: Record<string, unknown>): Promise<unknown> {\n const id = params.id;\n if (typeof id !== \"string\" || !id) {\n return null;\n }\n\n const result = await this.getFile.execute(id);\n if (result.isFail()) {\n return null;\n }\n\n return this.urlGenerator.generateUrl(result.value);\n }\n}\n\nexport const CmsResolveImageTool = AiOutputTool.createImplementation({\n implementation: CmsResolveImageToolImpl,\n dependencies: [GetFileUseCase, FileUrlGenerator]\n});\n"],"names":["CmsResolveImageToolImpl","getFile","urlGenerator","params","id","result","CmsResolveImageTool","AiOutputTool","GetFileUseCase","FileUrlGenerator"],"mappings":";;;AAIA,MAAMA;IAGF,YACYC,OAAiC,EACjCC,YAAwC,CAClD;aAFUD,OAAO,GAAPA;aACAC,YAAY,GAAZA;aAJH,IAAI,GAAG;IAKb;IAEH,MAAM,QAAQC,MAA+B,EAAoB;QAC7D,MAAMC,KAAKD,OAAO,EAAE;QACpB,IAAI,AAAc,YAAd,OAAOC,MAAmB,CAACA,IAC3B,OAAO;QAGX,MAAMC,SAAS,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAACD;QAC1C,IAAIC,OAAO,MAAM,IACb,OAAO;QAGX,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAACA,OAAO,KAAK;IACrD;AACJ;AAEO,MAAMC,sBAAsBC,aAAa,oBAAoB,CAAC;IACjE,gBAAgBP;IAChB,cAAc;QAACQ;QAAgBC;KAAiB;AACpD"}
@@ -0,0 +1,4 @@
1
+ export declare const CmsResolveImageToolFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { CmsResolveImageTool } from "./CmsResolveImageTool.js";
3
+ const CmsResolveImageToolFeature = createFeature({
4
+ name: "AiPowerUps/CmsResolveImageTool",
5
+ register (container) {
6
+ container.register(CmsResolveImageTool);
7
+ }
8
+ });
9
+ export { CmsResolveImageToolFeature };
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/CmsResolveImageTool/feature.js","sources":["../../../../src/api/features/CmsResolveImageTool/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CmsResolveImageTool } from \"./CmsResolveImageTool.js\";\n\nexport const CmsResolveImageToolFeature = createFeature({\n name: \"AiPowerUps/CmsResolveImageTool\",\n register(container) {\n container.register(CmsResolveImageTool);\n }\n});\n"],"names":["CmsResolveImageToolFeature","createFeature","container","CmsResolveImageTool"],"mappings":";;AAGO,MAAMA,6BAA6BC,cAAc;IACpD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
@@ -0,0 +1,20 @@
1
+ import { AiPowerUpsSettingsGroupGraphQLMapper } from "../../../api/features/shared/index.js";
2
+ import type { ConnectionsSettings } from "./types.js";
3
+ interface ApiConnectionPreset {
4
+ id: string;
5
+ name: string;
6
+ sdkName: string;
7
+ apiKey: string | null;
8
+ }
9
+ interface ApiConnections {
10
+ presets: ApiConnectionPreset[];
11
+ }
12
+ declare class ConnectionsGraphQLMapperImpl implements AiPowerUpsSettingsGroupGraphQLMapper.Interface {
13
+ readonly name = "connections";
14
+ toApi(internal: unknown): ApiConnections;
15
+ fromApi(api: unknown): ConnectionsSettings;
16
+ }
17
+ declare const _default: typeof ConnectionsGraphQLMapperImpl & {
18
+ __abstraction: import("@webiny/di").Abstraction<import("../shared/abstractions.js").IAiPowerUpsSettingsGroupGraphQLMapper>;
19
+ };
20
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import { AiPowerUpsSettingsGroupGraphQLMapper } from "../shared/index.js";
2
+ class ConnectionsGraphQLMapperImpl {
3
+ toApi(internal) {
4
+ const data = internal;
5
+ return {
6
+ presets: data.presets.map((p)=>({
7
+ id: p.id,
8
+ name: p.name,
9
+ sdkName: p.sdkName,
10
+ apiKey: p.apiKeyMasked ?? null
11
+ }))
12
+ };
13
+ }
14
+ fromApi(api) {
15
+ const data = api;
16
+ return {
17
+ presets: data.presets.map((p)=>({
18
+ id: p.id,
19
+ name: p.name,
20
+ sdkName: p.sdkName,
21
+ apiKey: p.apiKey,
22
+ apiKeyMasked: "",
23
+ apiKeyEncrypted: ""
24
+ }))
25
+ };
26
+ }
27
+ constructor(){
28
+ this.name = "connections";
29
+ }
30
+ }
31
+ const ConnectionsGraphQLMapper = AiPowerUpsSettingsGroupGraphQLMapper.createImplementation({
32
+ implementation: ConnectionsGraphQLMapperImpl,
33
+ dependencies: []
34
+ });
35
+ export default ConnectionsGraphQLMapper;
36
+
37
+ //# sourceMappingURL=ConnectionsGraphQLMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/Connections/ConnectionsGraphQLMapper.js","sources":["../../../../src/api/features/Connections/ConnectionsGraphQLMapper.ts"],"sourcesContent":["import { AiPowerUpsSettingsGroupGraphQLMapper } from \"~/api/features/shared/index.js\";\nimport type { ConnectionsSettings } from \"./types.js\";\n\ninterface ApiConnectionPreset {\n id: string;\n name: string;\n sdkName: string;\n apiKey: string | null;\n}\n\ninterface ApiConnections {\n presets: ApiConnectionPreset[];\n}\n\ninterface ApiInputConnectionPreset {\n id: string;\n name: string;\n sdkName: string;\n apiKey?: string;\n}\n\nclass ConnectionsGraphQLMapperImpl implements AiPowerUpsSettingsGroupGraphQLMapper.Interface {\n readonly name = \"connections\";\n\n toApi(internal: unknown): ApiConnections {\n const data = internal as ConnectionsSettings;\n return {\n presets: data.presets.map(p => ({\n id: p.id,\n name: p.name,\n sdkName: p.sdkName,\n // The admin form only ever sees the mask. The plaintext key never leaves the api.\n apiKey: p.apiKeyMasked ?? null\n }))\n };\n }\n\n fromApi(api: unknown): ConnectionsSettings {\n const data = api as { presets: ApiInputConnectionPreset[] };\n return {\n presets: data.presets.map(p => ({\n id: p.id,\n name: p.name,\n sdkName: p.sdkName,\n apiKey: p.apiKey,\n apiKeyMasked: \"\",\n apiKeyEncrypted: \"\"\n }))\n };\n }\n}\n\nexport default AiPowerUpsSettingsGroupGraphQLMapper.createImplementation({\n implementation: ConnectionsGraphQLMapperImpl,\n dependencies: []\n});\n"],"names":["ConnectionsGraphQLMapperImpl","internal","data","p","api","AiPowerUpsSettingsGroupGraphQLMapper"],"mappings":";AAqBA,MAAMA;IAGF,MAAMC,QAAiB,EAAkB;QACrC,MAAMC,OAAOD;QACb,OAAO;YACH,SAASC,KAAK,OAAO,CAAC,GAAG,CAACC,CAAAA,IAAM;oBAC5B,IAAIA,EAAE,EAAE;oBACR,MAAMA,EAAE,IAAI;oBACZ,SAASA,EAAE,OAAO;oBAElB,QAAQA,EAAE,YAAY,IAAI;gBAC9B;QACJ;IACJ;IAEA,QAAQC,GAAY,EAAuB;QACvC,MAAMF,OAAOE;QACb,OAAO;YACH,SAASF,KAAK,OAAO,CAAC,GAAG,CAACC,CAAAA,IAAM;oBAC5B,IAAIA,EAAE,EAAE;oBACR,MAAMA,EAAE,IAAI;oBACZ,SAASA,EAAE,OAAO;oBAClB,QAAQA,EAAE,MAAM;oBAChB,cAAc;oBACd,iBAAiB;gBACrB;QACJ;IACJ;;aA3BS,IAAI,GAAG;;AA4BpB;AAEA,iCAAeE,qCAAqC,oBAAoB,CAAC;IACrE,gBAAgBL;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ import { Encryption } from "@webiny/api-core/features/encryption/index.js";
3
+ import { Masker } from "@webiny/api-core/features/masker/index.js";
4
+ import { AiPowerUpsSettingsGroupHandler } from "../../../api/features/shared/index.js";
5
+ import type { ConnectionsSettings, PersistedConnections } from "./types.js";
6
+ declare class ConnectionsHandlerImpl implements AiPowerUpsSettingsGroupHandler.Interface {
7
+ private encryption;
8
+ private masker;
9
+ readonly name = "connections";
10
+ readonly inputSchema: z.ZodObject<{
11
+ presets: z.ZodArray<z.ZodObject<{
12
+ id: z.ZodString;
13
+ name: z.ZodString;
14
+ sdkName: z.ZodString;
15
+ apiKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
+ }, z.core.$strip>>;
17
+ }, z.core.$strip>;
18
+ constructor(encryption: Encryption.Interface, masker: Masker.Interface);
19
+ mapFromStorage(persisted: unknown, all?: Record<string, unknown>): ConnectionsSettings;
20
+ mapToStorage(internal: unknown, existing: unknown | null): Promise<PersistedConnections>;
21
+ }
22
+ declare const _default: typeof ConnectionsHandlerImpl & {
23
+ __abstraction: import("@webiny/di").Abstraction<import("../shared/abstractions.js").IAiPowerUpsSettingsGroupHandler>;
24
+ };
25
+ export default _default;
@@ -0,0 +1,84 @@
1
+ import { z } from "zod";
2
+ import { Encryption } from "@webiny/api-core/features/encryption/index.js";
3
+ import { Masker } from "@webiny/api-core/features/masker/index.js";
4
+ import { AiPowerUpsSettingsGroupHandler } from "../shared/index.js";
5
+ import { readLegacyProviderPresets } from "./legacyProviders.js";
6
+ import { sdkNameFromModel } from "../shared/modelId.js";
7
+ const inputSchema = z.object({
8
+ presets: z.array(z.object({
9
+ id: z.string().min(1),
10
+ name: z.string().min(1),
11
+ sdkName: z.string().min(1),
12
+ apiKey: z.string().nullish()
13
+ }))
14
+ });
15
+ class ConnectionsHandlerImpl {
16
+ constructor(encryption, masker){
17
+ this.encryption = encryption;
18
+ this.masker = masker;
19
+ this.name = "connections";
20
+ this.inputSchema = inputSchema;
21
+ }
22
+ mapFromStorage(persisted, all) {
23
+ if (persisted && "object" == typeof persisted) {
24
+ const data = persisted;
25
+ return {
26
+ presets: (data.presets ?? []).map((p)=>({
27
+ id: p.id,
28
+ name: p.name,
29
+ sdkName: p.sdkName,
30
+ apiKeyMasked: p.apiKeyMasked ?? "",
31
+ apiKeyEncrypted: p.apiKeyEncrypted ?? ""
32
+ }))
33
+ };
34
+ }
35
+ return {
36
+ presets: readLegacyProviderPresets(all).map((p)=>({
37
+ id: p.id,
38
+ name: p.name,
39
+ sdkName: sdkNameFromModel(p.model),
40
+ apiKeyMasked: p.apiKeyMasked ?? "",
41
+ apiKeyEncrypted: p.apiKeyEncrypted ?? ""
42
+ }))
43
+ };
44
+ }
45
+ async mapToStorage(internal, existing) {
46
+ const input = internal;
47
+ const existingPresets = existing?.presets ?? [];
48
+ const presets = await Promise.all(input.presets.map(async (preset)=>{
49
+ const existingMatch = existingPresets.find((ep)=>ep.id === preset.id);
50
+ let apiKeyEncrypted;
51
+ let apiKeyMasked;
52
+ if (preset.apiKey && preset.apiKey !== existingMatch?.apiKeyMasked) {
53
+ apiKeyEncrypted = await this.encryption.encrypt(preset.apiKey);
54
+ apiKeyMasked = this.masker.mask(preset.apiKey, [
55
+ 8,
56
+ 4
57
+ ]);
58
+ } else {
59
+ apiKeyEncrypted = existingMatch?.apiKeyEncrypted ?? "";
60
+ apiKeyMasked = existingMatch?.apiKeyMasked ?? "";
61
+ }
62
+ return {
63
+ id: preset.id,
64
+ name: preset.name,
65
+ sdkName: preset.sdkName,
66
+ apiKeyEncrypted,
67
+ apiKeyMasked
68
+ };
69
+ }));
70
+ return {
71
+ presets
72
+ };
73
+ }
74
+ }
75
+ const ConnectionsHandler = AiPowerUpsSettingsGroupHandler.createImplementation({
76
+ implementation: ConnectionsHandlerImpl,
77
+ dependencies: [
78
+ Encryption,
79
+ Masker
80
+ ]
81
+ });
82
+ export default ConnectionsHandler;
83
+
84
+ //# sourceMappingURL=ConnectionsHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/Connections/ConnectionsHandler.js","sources":["../../../../src/api/features/Connections/ConnectionsHandler.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { Encryption } from \"@webiny/api-core/features/encryption/index.js\";\nimport { Masker } from \"@webiny/api-core/features/masker/index.js\";\nimport { AiPowerUpsSettingsGroupHandler } from \"~/api/features/shared/index.js\";\nimport { readLegacyProviderPresets } from \"./legacyProviders.js\";\nimport { sdkNameFromModel } from \"~/api/features/shared/modelId.js\";\nimport type {\n ConnectionsSettings,\n PersistedAiConnectionPreset,\n PersistedConnections\n} from \"./types.js\";\n\nconst inputSchema = z.object({\n presets: z.array(\n z.object({\n id: z.string().min(1),\n name: z.string().min(1),\n sdkName: z.string().min(1),\n apiKey: z.string().nullish()\n })\n )\n});\n\nclass ConnectionsHandlerImpl implements AiPowerUpsSettingsGroupHandler.Interface {\n readonly name = \"connections\";\n readonly inputSchema = inputSchema;\n\n constructor(\n private encryption: Encryption.Interface,\n private masker: Masker.Interface\n ) {}\n\n mapFromStorage(persisted: unknown, all?: Record<string, unknown>): ConnectionsSettings {\n if (persisted && typeof persisted === \"object\") {\n const data = persisted as PersistedConnections;\n return {\n presets: (data.presets ?? []).map(p => ({\n id: p.id,\n name: p.name,\n sdkName: p.sdkName,\n apiKeyMasked: p.apiKeyMasked ?? \"\",\n apiKeyEncrypted: p.apiKeyEncrypted ?? \"\"\n }))\n };\n }\n\n /*\n * No `connections` section yet, so derive one from the legacy `providers` presets. The keys\n * are already encrypted in storage, which is why this can be a pure read: nothing has to be\n * re-encrypted, and nothing is written back until the next save.\n *\n * Dropping the model here is safe. `ModelRoles` reads the same legacy section and lifts\n * the first preset's model into the `standard` role, which is the only model the old code\n * ever used.\n */\n return {\n presets: readLegacyProviderPresets(all).map(p => ({\n id: p.id,\n name: p.name,\n sdkName: sdkNameFromModel(p.model),\n apiKeyMasked: p.apiKeyMasked ?? \"\",\n apiKeyEncrypted: p.apiKeyEncrypted ?? \"\"\n }))\n };\n }\n\n async mapToStorage(internal: unknown, existing: unknown | null): Promise<PersistedConnections> {\n const input = internal as ConnectionsSettings;\n const existingPresets = (existing as ConnectionsSettings | null)?.presets ?? [];\n\n const presets: PersistedAiConnectionPreset[] = await Promise.all(\n input.presets.map(async preset => {\n const existingMatch = existingPresets.find(ep => ep.id === preset.id);\n\n let apiKeyEncrypted: string;\n let apiKeyMasked: string;\n\n if (!preset.apiKey || preset.apiKey === existingMatch?.apiKeyMasked) {\n // The form sends back the mask when the key was left alone. Carry it forward.\n apiKeyEncrypted = existingMatch?.apiKeyEncrypted ?? \"\";\n apiKeyMasked = existingMatch?.apiKeyMasked ?? \"\";\n } else {\n apiKeyEncrypted = await this.encryption.encrypt(preset.apiKey);\n apiKeyMasked = this.masker.mask(preset.apiKey, [8, 4]);\n }\n\n return {\n id: preset.id,\n name: preset.name,\n sdkName: preset.sdkName,\n apiKeyEncrypted,\n apiKeyMasked\n };\n })\n );\n\n return { presets };\n }\n}\n\nexport default AiPowerUpsSettingsGroupHandler.createImplementation({\n implementation: ConnectionsHandlerImpl,\n dependencies: [Encryption, Masker]\n});\n"],"names":["inputSchema","z","ConnectionsHandlerImpl","encryption","masker","persisted","all","data","p","readLegacyProviderPresets","sdkNameFromModel","internal","existing","input","existingPresets","presets","Promise","preset","existingMatch","ep","apiKeyEncrypted","apiKeyMasked","AiPowerUpsSettingsGroupHandler","Encryption","Masker"],"mappings":";;;;;;AAYA,MAAMA,cAAcC,EAAE,MAAM,CAAC;IACzB,SAASA,EAAE,KAAK,CACZA,EAAE,MAAM,CAAC;QACL,IAAIA,EAAE,MAAM,GAAG,GAAG,CAAC;QACnB,MAAMA,EAAE,MAAM,GAAG,GAAG,CAAC;QACrB,SAASA,EAAE,MAAM,GAAG,GAAG,CAAC;QACxB,QAAQA,EAAE,MAAM,GAAG,OAAO;IAC9B;AAER;AAEA,MAAMC;IAIF,YACYC,UAAgC,EAChCC,MAAwB,CAClC;aAFUD,UAAU,GAAVA;aACAC,MAAM,GAANA;aALH,IAAI,GAAG;aACP,WAAW,GAAGJ;IAKpB;IAEH,eAAeK,SAAkB,EAAEC,GAA6B,EAAuB;QACnF,IAAID,aAAa,AAAqB,YAArB,OAAOA,WAAwB;YAC5C,MAAME,OAAOF;YACb,OAAO;gBACH,SAAUE,AAAAA,CAAAA,KAAK,OAAO,IAAI,EAAC,EAAG,GAAG,CAACC,CAAAA,IAAM;wBACpC,IAAIA,EAAE,EAAE;wBACR,MAAMA,EAAE,IAAI;wBACZ,SAASA,EAAE,OAAO;wBAClB,cAAcA,EAAE,YAAY,IAAI;wBAChC,iBAAiBA,EAAE,eAAe,IAAI;oBAC1C;YACJ;QACJ;QAWA,OAAO;YACH,SAASC,0BAA0BH,KAAK,GAAG,CAACE,CAAAA,IAAM;oBAC9C,IAAIA,EAAE,EAAE;oBACR,MAAMA,EAAE,IAAI;oBACZ,SAASE,iBAAiBF,EAAE,KAAK;oBACjC,cAAcA,EAAE,YAAY,IAAI;oBAChC,iBAAiBA,EAAE,eAAe,IAAI;gBAC1C;QACJ;IACJ;IAEA,MAAM,aAAaG,QAAiB,EAAEC,QAAwB,EAAiC;QAC3F,MAAMC,QAAQF;QACd,MAAMG,kBAAmBF,UAAyC,WAAW,EAAE;QAE/E,MAAMG,UAAyC,MAAMC,QAAQ,GAAG,CAC5DH,MAAM,OAAO,CAAC,GAAG,CAAC,OAAMI;YACpB,MAAMC,gBAAgBJ,gBAAgB,IAAI,CAACK,CAAAA,KAAMA,GAAG,EAAE,KAAKF,OAAO,EAAE;YAEpE,IAAIG;YACJ,IAAIC;YAEJ,IAAI,AAACJ,OAAO,MAAM,IAAIA,OAAO,MAAM,KAAKC,eAAe,cAIhD;gBACHE,kBAAkB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACH,OAAO,MAAM;gBAC7DI,eAAe,IAAI,CAAC,MAAM,CAAC,IAAI,CAACJ,OAAO,MAAM,EAAE;oBAAC;oBAAG;iBAAE;YACzD,OAPqE;gBAEjEG,kBAAkBF,eAAe,mBAAmB;gBACpDG,eAAeH,eAAe,gBAAgB;YAClD;YAKA,OAAO;gBACH,IAAID,OAAO,EAAE;gBACb,MAAMA,OAAO,IAAI;gBACjB,SAASA,OAAO,OAAO;gBACvBG;gBACAC;YACJ;QACJ;QAGJ,OAAO;YAAEN;QAAQ;IACrB;AACJ;AAEA,2BAAeO,+BAA+B,oBAAoB,CAAC;IAC/D,gBAAgBpB;IAChB,cAAc;QAACqB;QAAYC;KAAO;AACtC"}
@@ -0,0 +1,4 @@
1
+ export declare const ConnectionsFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,13 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import ConnectionsHandler from "./ConnectionsHandler.js";
3
+ import ConnectionsGraphQLMapper from "./ConnectionsGraphQLMapper.js";
4
+ const ConnectionsFeature = createFeature({
5
+ name: "AiPowerUpsConnections",
6
+ register (container) {
7
+ container.register(ConnectionsHandler);
8
+ container.register(ConnectionsGraphQLMapper);
9
+ }
10
+ });
11
+ export { ConnectionsFeature };
12
+
13
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/Connections/feature.js","sources":["../../../../src/api/features/Connections/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport ConnectionsHandler from \"./ConnectionsHandler.js\";\nimport ConnectionsGraphQLMapper from \"./ConnectionsGraphQLMapper.js\";\n\nexport const ConnectionsFeature = createFeature({\n name: \"AiPowerUpsConnections\",\n register(container) {\n container.register(ConnectionsHandler);\n container.register(ConnectionsGraphQLMapper);\n }\n});\n"],"names":["ConnectionsFeature","createFeature","container","ConnectionsHandler","ConnectionsGraphQLMapper"],"mappings":";;;AAIO,MAAMA,qBAAqBC,cAAc;IAC5C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;IACvB;AACJ"}
@@ -0,0 +1,2 @@
1
+ export type { AiConnectionPreset, ConnectionsSettings } from "./types.js";
2
+ export { ConnectionsFeature } from "./feature.js";
@@ -0,0 +1 @@
1
+ export { ConnectionsFeature } from "./feature.js";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Reading the settings section `connections` replaces.
3
+ *
4
+ * `providers` bundled a credential with a single model. Nothing writes it any more, but an upgraded
5
+ * project still has one and has never saved since, so both `Connections` and `ModelRoles` derive
6
+ * their first value from it. That makes this the one piece of code allowed to reach into a section
7
+ * nobody owns.
8
+ *
9
+ * It lives in its own module, and not with the connection types, because it is the only part of
10
+ * this feature with an expiry date: when the legacy section is finally dropped, this file and its
11
+ * two callers go with it.
12
+ */
13
+ /** Shape of a preset in the legacy `providers` section. */
14
+ export interface LegacyProviderPreset {
15
+ id: string;
16
+ name: string;
17
+ model?: string;
18
+ apiKeyEncrypted?: string;
19
+ apiKeyMasked?: string;
20
+ }
21
+ /**
22
+ * Deliberately defensive. This parses a blob written by an older version against no schema, so
23
+ * every level is checked rather than asserted: a project that never had `providers` and one that
24
+ * has a malformed one both read as "nothing to migrate" instead of throwing on read.
25
+ */
26
+ export declare const readLegacyProviderPresets: (all: Record<string, unknown> | undefined) => LegacyProviderPreset[];
@@ -0,0 +1,9 @@
1
+ const readLegacyProviderPresets = (all)=>{
2
+ const providers = all?.["providers"];
3
+ if (!providers || "object" != typeof providers) return [];
4
+ const presets = providers.presets;
5
+ return Array.isArray(presets) ? presets : [];
6
+ };
7
+ export { readLegacyProviderPresets };
8
+
9
+ //# sourceMappingURL=legacyProviders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api/features/Connections/legacyProviders.js","sources":["../../../../src/api/features/Connections/legacyProviders.ts"],"sourcesContent":["/**\n * Reading the settings section `connections` replaces.\n *\n * `providers` bundled a credential with a single model. Nothing writes it any more, but an upgraded\n * project still has one and has never saved since, so both `Connections` and `ModelRoles` derive\n * their first value from it. That makes this the one piece of code allowed to reach into a section\n * nobody owns.\n *\n * It lives in its own module, and not with the connection types, because it is the only part of\n * this feature with an expiry date: when the legacy section is finally dropped, this file and its\n * two callers go with it.\n */\n\n/** Shape of a preset in the legacy `providers` section. */\nexport interface LegacyProviderPreset {\n id: string;\n name: string;\n model?: string;\n apiKeyEncrypted?: string;\n apiKeyMasked?: string;\n}\n\n/**\n * Deliberately defensive. This parses a blob written by an older version against no schema, so\n * every level is checked rather than asserted: a project that never had `providers` and one that\n * has a malformed one both read as \"nothing to migrate\" instead of throwing on read.\n */\nexport const readLegacyProviderPresets = (\n all: Record<string, unknown> | undefined\n): LegacyProviderPreset[] => {\n const providers = all?.[\"providers\"];\n if (!providers || typeof providers !== \"object\") {\n return [];\n }\n\n const presets = (providers as { presets?: unknown }).presets;\n return Array.isArray(presets) ? (presets as LegacyProviderPreset[]) : [];\n};\n"],"names":["readLegacyProviderPresets","all","providers","presets","Array"],"mappings":"AA2BO,MAAMA,4BAA4B,CACrCC;IAEA,MAAMC,YAAYD,KAAK,CAAC,YAAY;IACpC,IAAI,CAACC,aAAa,AAAqB,YAArB,OAAOA,WACrB,OAAO,EAAE;IAGb,MAAMC,UAAWD,UAAoC,OAAO;IAC5D,OAAOE,MAAM,OAAO,CAACD,WAAYA,UAAqC,EAAE;AAC5E"}
@@ -0,0 +1,36 @@
1
+ import type { IAiPowerUpsSettings } from "../../../api/types.js";
2
+ /**
3
+ * A connection is one credential for one vendor. It carries no model.
4
+ *
5
+ * The section it replaces (`providers`) bundled a key with a single model, so a project that wanted
6
+ * two Anthropic models had to paste the same key twice and keep both copies in sync. Splitting the
7
+ * two means the key is entered once and every model that vendor offers is then selectable.
8
+ */
9
+ export interface AiConnectionPreset {
10
+ id: string;
11
+ name: string;
12
+ /** AI SDK namespace, e.g. "anthropic" or "openai". Matches `AiSdkFactory.id`. */
13
+ sdkName: string;
14
+ /** Plaintext. Only ever set on the way in from the admin form, never persisted. */
15
+ apiKey?: string;
16
+ apiKeyMasked: string;
17
+ apiKeyEncrypted: string;
18
+ }
19
+ declare module "~/api/types.js" {
20
+ interface IAiPowerUpsSettings {
21
+ connections: {
22
+ presets: AiConnectionPreset[];
23
+ };
24
+ }
25
+ }
26
+ export type ConnectionsSettings = IAiPowerUpsSettings["connections"];
27
+ export interface PersistedAiConnectionPreset {
28
+ id: string;
29
+ name: string;
30
+ sdkName: string;
31
+ apiKeyEncrypted: string;
32
+ apiKeyMasked: string;
33
+ }
34
+ export interface PersistedConnections {
35
+ presets: PersistedAiConnectionPreset[];
36
+ }
File without changes
@@ -15,7 +15,7 @@ class GetSettingsRepositoryImpl {
15
15
  const storeResult = await this.keyValueStore.get(AI_POWER_UPS_SETTINGS);
16
16
  const raw = storeResult.isOk() && storeResult.value ? storeResult.value : {};
17
17
  const result = {};
18
- for (const handler of this.handlers)result[handler.name] = handler.mapFromStorage(raw[handler.name]);
18
+ for (const handler of this.handlers)result[handler.name] = handler.mapFromStorage(raw[handler.name], raw);
19
19
  for (const key of Object.keys(raw))if (!(key in result)) result[key] = raw[key];
20
20
  const mapped = result;
21
21
  this.cache.set(raw, mapped);