@webiny/ai-powerups 6.6.0-alpha.4 → 6.6.0-alpha.5

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 (211) hide show
  1. package/AiPowerups.d.ts +12 -0
  2. package/AiPowerups.js +1 -2
  3. package/AiPowerups.js.map +1 -1
  4. package/admin/Extension.d.ts +1 -1
  5. package/admin/Extension.js +6 -2
  6. package/admin/Extension.js.map +1 -1
  7. package/admin/domain/modelRoles.d.ts +17 -0
  8. package/admin/domain/modelRoles.js +8 -0
  9. package/admin/domain/modelRoles.js.map +1 -0
  10. package/admin/features/feature.js +2 -0
  11. package/admin/features/feature.js.map +1 -1
  12. package/admin/features/listCapabilities/ListCapabilitiesGateway.d.ts +12 -0
  13. package/admin/features/listCapabilities/ListCapabilitiesGateway.js +34 -0
  14. package/admin/features/listCapabilities/ListCapabilitiesGateway.js.map +1 -0
  15. package/admin/features/listCapabilities/ListCapabilitiesRepository.d.ts +13 -0
  16. package/admin/features/listCapabilities/ListCapabilitiesRepository.js +27 -0
  17. package/admin/features/listCapabilities/ListCapabilitiesRepository.js.map +1 -0
  18. package/admin/features/listCapabilities/ListCapabilitiesUseCase.d.ts +10 -0
  19. package/admin/features/listCapabilities/ListCapabilitiesUseCase.js +18 -0
  20. package/admin/features/listCapabilities/ListCapabilitiesUseCase.js.map +1 -0
  21. package/admin/features/listCapabilities/abstractions.d.ts +28 -0
  22. package/admin/features/listCapabilities/abstractions.js +7 -0
  23. package/admin/features/listCapabilities/abstractions.js.map +1 -0
  24. package/admin/features/listCapabilities/feature.d.ts +3 -0
  25. package/admin/features/listCapabilities/feature.js +21 -0
  26. package/admin/features/listCapabilities/feature.js.map +1 -0
  27. package/admin/features/listCapabilities/index.d.ts +3 -0
  28. package/admin/features/listCapabilities/index.js +2 -0
  29. package/admin/features/settings/shared/abstractions.d.ts +58 -25
  30. package/admin/features/settings/shared/abstractions.js.map +1 -1
  31. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.js +13 -1
  32. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.js.map +1 -1
  33. package/admin/presentation/AiPowerUpsSettings/feature.js +6 -2
  34. package/admin/presentation/AiPowerUpsSettings/feature.js.map +1 -1
  35. package/admin/presentation/AiPowerUpsSettings/hasUsableModel.d.ts +13 -0
  36. package/admin/presentation/AiPowerUpsSettings/hasUsableModel.js +9 -0
  37. package/admin/presentation/AiPowerUpsSettings/hasUsableModel.js.map +1 -0
  38. package/admin/presentation/AiPowerUpsSettings/index.d.ts +1 -0
  39. package/admin/presentation/AiPowerUpsSettings/index.js +1 -0
  40. package/admin/presentation/AiPowerUpsSettings/settingsGroup.d.ts +9 -0
  41. package/admin/presentation/AiPowerUpsSettings/settingsGroup.js.map +1 -1
  42. package/admin/presentation/CapabilitiesSettings.d.ts +39 -0
  43. package/admin/presentation/CapabilitiesSettings.js +104 -0
  44. package/admin/presentation/CapabilitiesSettings.js.map +1 -0
  45. package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.js +2 -2
  46. package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.js.map +1 -1
  47. package/admin/presentation/ConnectionsSettings.d.ts +25 -0
  48. package/admin/presentation/ConnectionsSettings.js +52 -0
  49. package/admin/presentation/ConnectionsSettings.js.map +1 -0
  50. package/admin/presentation/ModelRolesSettings.d.ts +29 -0
  51. package/admin/presentation/ModelRolesSettings.js +67 -0
  52. package/admin/presentation/ModelRolesSettings.js.map +1 -0
  53. package/admin/presentation/WbContentGeneration/GenerateContentButton.js +2 -2
  54. package/admin/presentation/WbContentGeneration/GenerateContentButton.js.map +1 -1
  55. package/admin/presentation/modelRoles.d.ts +10 -0
  56. package/admin/presentation/modelRoles.js +23 -0
  57. package/admin/presentation/modelRoles.js.map +1 -0
  58. package/api/Extension.js +10 -2
  59. package/api/Extension.js.map +1 -1
  60. package/api/features/AdminAssistant/AdminAssistantStreamRoute.d.ts +34 -0
  61. package/api/features/AdminAssistant/AdminAssistantStreamRoute.js +42 -0
  62. package/api/features/AdminAssistant/AdminAssistantStreamRoute.js.map +1 -0
  63. package/api/features/AdminAssistant/AdminAssistantUseCase.d.ts +42 -0
  64. package/api/features/AdminAssistant/AdminAssistantUseCase.js +170 -0
  65. package/api/features/AdminAssistant/AdminAssistantUseCase.js.map +1 -0
  66. package/api/features/AdminAssistant/abstractions.d.ts +38 -0
  67. package/api/features/AdminAssistant/abstractions.js +6 -0
  68. package/api/features/AdminAssistant/abstractions.js.map +1 -0
  69. package/api/features/AdminAssistant/approvals.d.ts +29 -0
  70. package/api/features/AdminAssistant/approvals.js +30 -0
  71. package/api/features/AdminAssistant/approvals.js.map +1 -0
  72. package/api/features/AdminAssistant/capability.d.ts +31 -0
  73. package/api/features/AdminAssistant/capability.js +19 -0
  74. package/api/features/AdminAssistant/capability.js.map +1 -0
  75. package/api/features/AdminAssistant/events.d.ts +54 -0
  76. package/api/features/AdminAssistant/events.js +0 -0
  77. package/api/features/AdminAssistant/feature.d.ts +12 -0
  78. package/api/features/AdminAssistant/feature.js +23 -0
  79. package/api/features/AdminAssistant/feature.js.map +1 -0
  80. package/api/features/AdminAssistant/index.d.ts +5 -0
  81. package/api/features/AdminAssistant/index.js +3 -0
  82. package/api/features/AdminAssistant/parseChatBody.d.ts +14 -0
  83. package/api/features/AdminAssistant/parseChatBody.js +33 -0
  84. package/api/features/AdminAssistant/parseChatBody.js.map +1 -0
  85. package/api/features/AdminAssistant/systemPrompt.d.ts +7 -0
  86. package/api/features/AdminAssistant/systemPrompt.js +24 -0
  87. package/api/features/AdminAssistant/systemPrompt.js.map +1 -0
  88. package/api/features/AiImageEnrichment/PrepareImageEnrichmentUseCase.d.ts +3 -5
  89. package/api/features/AiImageEnrichment/PrepareImageEnrichmentUseCase.js +11 -16
  90. package/api/features/AiImageEnrichment/PrepareImageEnrichmentUseCase.js.map +1 -1
  91. package/api/features/AiImageEnrichment/abstractions.d.ts +6 -0
  92. package/api/features/AiImageEnrichment/abstractions.js.map +1 -1
  93. package/api/features/AiImageEnrichment/buildEnrichmentAiRequest.js +2 -2
  94. package/api/features/AiImageEnrichment/buildEnrichmentAiRequest.js.map +1 -1
  95. package/api/features/AiImageEnrichment/capability.d.ts +18 -0
  96. package/api/features/AiImageEnrichment/capability.js +19 -0
  97. package/api/features/AiImageEnrichment/capability.js.map +1 -0
  98. package/api/features/AiImageEnrichment/errors.d.ts +6 -1
  99. package/api/features/AiImageEnrichment/errors.js +2 -2
  100. package/api/features/AiImageEnrichment/errors.js.map +1 -1
  101. package/api/features/AiImageEnrichment/feature.js +2 -0
  102. package/api/features/AiImageEnrichment/feature.js.map +1 -1
  103. package/api/features/Capabilities/CapabilitiesHandler.d.ts +28 -0
  104. package/api/features/Capabilities/CapabilitiesHandler.js +56 -0
  105. package/api/features/Capabilities/CapabilitiesHandler.js.map +1 -0
  106. package/api/features/Capabilities/ListAiCapabilitiesUseCase.d.ts +18 -0
  107. package/api/features/Capabilities/ListAiCapabilitiesUseCase.js +28 -0
  108. package/api/features/Capabilities/ListAiCapabilitiesUseCase.js.map +1 -0
  109. package/api/features/Capabilities/ResolveAiCapabilityUseCase.d.ts +30 -0
  110. package/api/features/Capabilities/ResolveAiCapabilityUseCase.js +88 -0
  111. package/api/features/Capabilities/ResolveAiCapabilityUseCase.js.map +1 -0
  112. package/api/features/Capabilities/abstractions.d.ts +77 -0
  113. package/api/features/Capabilities/abstractions.js +7 -0
  114. package/api/features/Capabilities/abstractions.js.map +1 -0
  115. package/api/features/Capabilities/composeSystemPrompt.d.ts +14 -0
  116. package/api/features/Capabilities/composeSystemPrompt.js +13 -0
  117. package/api/features/Capabilities/composeSystemPrompt.js.map +1 -0
  118. package/api/features/Capabilities/feature.d.ts +4 -0
  119. package/api/features/Capabilities/feature.js +15 -0
  120. package/api/features/Capabilities/feature.js.map +1 -0
  121. package/api/features/Capabilities/index.d.ts +5 -0
  122. package/api/features/Capabilities/index.js +3 -0
  123. package/api/features/Capabilities/types.d.ts +86 -0
  124. package/api/features/Capabilities/types.js +4 -0
  125. package/api/features/Capabilities/types.js.map +1 -0
  126. package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.d.ts +3 -5
  127. package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.js +11 -65
  128. package/api/features/CmsCompareEntryRevisions/CmsCompareEntryRevisionsUseCase.js.map +1 -1
  129. package/api/features/CmsCompareEntryRevisions/capability.d.ts +13 -0
  130. package/api/features/CmsCompareEntryRevisions/capability.js +64 -0
  131. package/api/features/CmsCompareEntryRevisions/capability.js.map +1 -0
  132. package/api/features/CmsCompareEntryRevisions/feature.js +2 -0
  133. package/api/features/CmsCompareEntryRevisions/feature.js.map +1 -1
  134. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.d.ts +3 -5
  135. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.js +11 -19
  136. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.js.map +1 -1
  137. package/api/features/CmsGenerateEntryContent/capability.d.ts +17 -0
  138. package/api/features/CmsGenerateEntryContent/capability.js +17 -0
  139. package/api/features/CmsGenerateEntryContent/capability.js.map +1 -0
  140. package/api/features/CmsGenerateEntryContent/feature.js +2 -0
  141. package/api/features/CmsGenerateEntryContent/feature.js.map +1 -1
  142. package/api/features/Connections/ConnectionsGraphQLMapper.d.ts +20 -0
  143. package/api/features/Connections/ConnectionsGraphQLMapper.js +37 -0
  144. package/api/features/Connections/ConnectionsGraphQLMapper.js.map +1 -0
  145. package/api/features/Connections/ConnectionsHandler.d.ts +25 -0
  146. package/api/features/Connections/ConnectionsHandler.js +84 -0
  147. package/api/features/Connections/ConnectionsHandler.js.map +1 -0
  148. package/api/features/Connections/feature.d.ts +4 -0
  149. package/api/features/Connections/feature.js +13 -0
  150. package/api/features/Connections/feature.js.map +1 -0
  151. package/api/features/Connections/index.d.ts +2 -0
  152. package/api/features/Connections/index.js +1 -0
  153. package/api/features/Connections/legacyProviders.d.ts +26 -0
  154. package/api/features/Connections/legacyProviders.js +9 -0
  155. package/api/features/Connections/legacyProviders.js.map +1 -0
  156. package/api/features/Connections/types.d.ts +36 -0
  157. package/api/features/Connections/types.js +0 -0
  158. package/api/features/GetSettings/GetSettingsRepository.js +1 -1
  159. package/api/features/GetSettings/GetSettingsRepository.js.map +1 -1
  160. package/api/features/ModelRoles/ModelRolesHandler.d.ts +15 -0
  161. package/api/features/ModelRoles/ModelRolesHandler.js +68 -0
  162. package/api/features/ModelRoles/ModelRolesHandler.js.map +1 -0
  163. package/api/features/ModelRoles/feature.d.ts +4 -0
  164. package/api/features/ModelRoles/feature.js +11 -0
  165. package/api/features/ModelRoles/feature.js.map +1 -0
  166. package/api/features/ModelRoles/index.d.ts +4 -0
  167. package/api/features/ModelRoles/index.js +2 -0
  168. package/api/features/ModelRoles/roles.d.ts +16 -0
  169. package/api/features/ModelRoles/roles.js +9 -0
  170. package/api/features/ModelRoles/roles.js.map +1 -0
  171. package/api/features/ModelRoles/types.d.ts +21 -0
  172. package/api/features/ModelRoles/types.js +7 -0
  173. package/api/features/ModelRoles/types.js.map +1 -0
  174. package/api/features/UpdateSettings/UpdateSettingsRepository.js +2 -2
  175. package/api/features/UpdateSettings/UpdateSettingsRepository.js.map +1 -1
  176. package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.d.ts +3 -5
  177. package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.js +11 -19
  178. package/api/features/WbGeneratePageContent/WbGeneratePageContentUseCase.js.map +1 -1
  179. package/api/features/WbGeneratePageContent/capability.d.ts +16 -0
  180. package/api/features/WbGeneratePageContent/capability.js +17 -0
  181. package/api/features/WbGeneratePageContent/capability.js.map +1 -0
  182. package/api/features/WbGeneratePageContent/feature.js +2 -0
  183. package/api/features/WbGeneratePageContent/feature.js.map +1 -1
  184. package/api/features/WbTranslatePage/WbTranslatePageDecorator.d.ts +5 -5
  185. package/api/features/WbTranslatePage/WbTranslatePageDecorator.js +19 -19
  186. package/api/features/WbTranslatePage/WbTranslatePageDecorator.js.map +1 -1
  187. package/api/features/WbTranslatePage/capability.d.ts +13 -0
  188. package/api/features/WbTranslatePage/capability.js +19 -0
  189. package/api/features/WbTranslatePage/capability.js.map +1 -0
  190. package/api/features/WbTranslatePage/feature.js +2 -0
  191. package/api/features/WbTranslatePage/feature.js.map +1 -1
  192. package/api/features/shared/abstractions.d.ts +6 -1
  193. package/api/features/shared/abstractions.js.map +1 -1
  194. package/api/features/shared/modelId.d.ts +11 -0
  195. package/api/features/shared/modelId.js +4 -0
  196. package/api/features/shared/modelId.js.map +1 -0
  197. package/api/graphql/BaseGraphQLSchema.js +16 -0
  198. package/api/graphql/BaseGraphQLSchema.js.map +1 -1
  199. package/api/types.d.ts +3 -0
  200. package/api/types.js +3 -0
  201. package/exports/api/ai-powerups.d.ts +5 -0
  202. package/exports/api/ai-powerups.js +3 -0
  203. package/package.json +24 -26
  204. package/api/features/AiChatProvider/PowerUpsAiChatProvider.d.ts +0 -24
  205. package/api/features/AiChatProvider/PowerUpsAiChatProvider.js +0 -31
  206. package/api/features/AiChatProvider/PowerUpsAiChatProvider.js.map +0 -1
  207. package/api/features/AiChatProvider/feature.d.ts +0 -9
  208. package/api/features/AiChatProvider/feature.js +0 -11
  209. package/api/features/AiChatProvider/feature.js.map +0 -1
  210. package/api/features/AiChatProvider/index.d.ts +0 -2
  211. package/api/features/AiChatProvider/index.js +0 -2
package/AiPowerups.d.ts CHANGED
@@ -1,2 +1,14 @@
1
1
  import React from "react";
2
+ /**
3
+ * Both extensions load unconditionally; each gates itself at runtime.
4
+ *
5
+ * This used to sit inside `FeatureFlag.CanUseAiPowerups`, which reads project config while the
6
+ * project graph is built, so the decision was baked in at deploy time. A WCP licence that granted
7
+ * AI Power-Ups therefore did nothing until the next deploy, which is the wrong shape for something
8
+ * a customer can buy at any moment.
9
+ *
10
+ * The gate now lives where the licence is readable: `api/Extension.ts` checks the effective flags
11
+ * at `register()` (the licence is refreshed per request, before any feature registers), and
12
+ * `admin/Extension.tsx` checks them on render. `ai-chat` and `api-aco` already gate this way.
13
+ */
2
14
  export declare const AiPowerups: () => React.JSX.Element;
package/AiPowerups.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import react from "react";
2
2
  import { Admin, Api } from "@webiny/project-aws";
3
- import { FeatureFlag } from "@webiny/project";
4
- const AiPowerups = ()=>/*#__PURE__*/ react.createElement(FeatureFlag.CanUseAiPowerups, null, /*#__PURE__*/ react.createElement(Api.Extension, {
3
+ const AiPowerups = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Api.Extension, {
5
4
  src: import.meta.dirname + "/api/Extension.js"
6
5
  }), /*#__PURE__*/ react.createElement(Admin.Extension, {
7
6
  src: import.meta.dirname + "/admin/Extension.js"
package/AiPowerups.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"AiPowerups.js","sources":["../src/AiPowerups.tsx"],"sourcesContent":["import React from \"react\";\nimport { Api, Admin } from \"@webiny/project-aws\";\nimport { FeatureFlag } from \"@webiny/project\";\n\nexport const AiPowerups = () => {\n return (\n <FeatureFlag.CanUseAiPowerups>\n {/* Api extensions */}\n <Api.Extension src={import.meta.dirname + \"/api/Extension.js\"} />\n\n {/* Admin extensions */}\n <Admin.Extension src={import.meta.dirname + \"/admin/Extension.js\"} />\n </FeatureFlag.CanUseAiPowerups>\n );\n};\n"],"names":["AiPowerups","FeatureFlag","Api","Admin"],"mappings":";;;AAIO,MAAMA,aAAa,IACf,WAAP,GACI,oBAACC,YAAY,gBAAgB,sBAEzB,oBAACC,IAAI,SAAS;QAAC,KAAK,YAAY,OAAO,GAAG;sBAG1C,oBAACC,MAAM,SAAS;QAAC,KAAK,YAAY,OAAO,GAAG"}
1
+ {"version":3,"file":"AiPowerups.js","sources":["../src/AiPowerups.tsx"],"sourcesContent":["import React from \"react\";\nimport { Api, Admin } from \"@webiny/project-aws\";\n\n/**\n * Both extensions load unconditionally; each gates itself at runtime.\n *\n * This used to sit inside `FeatureFlag.CanUseAiPowerups`, which reads project config while the\n * project graph is built, so the decision was baked in at deploy time. A WCP licence that granted\n * AI Power-Ups therefore did nothing until the next deploy, which is the wrong shape for something\n * a customer can buy at any moment.\n *\n * The gate now lives where the licence is readable: `api/Extension.ts` checks the effective flags\n * at `register()` (the licence is refreshed per request, before any feature registers), and\n * `admin/Extension.tsx` checks them on render. `ai-chat` and `api-aco` already gate this way.\n */\nexport const AiPowerups = () => {\n return (\n <>\n {/* Api extensions */}\n <Api.Extension src={import.meta.dirname + \"/api/Extension.js\"} />\n\n {/* Admin extensions */}\n <Admin.Extension src={import.meta.dirname + \"/admin/Extension.js\"} />\n </>\n );\n};\n"],"names":["AiPowerups","Api","Admin"],"mappings":";;AAeO,MAAMA,aAAa,IACf,WAAP,GACI,wDAEI,oBAACC,IAAI,SAAS;QAAC,KAAK,YAAY,OAAO,GAAG;sBAG1C,oBAACC,MAAM,SAAS;QAAC,KAAK,YAAY,OAAO,GAAG"}
@@ -1,2 +1,2 @@
1
1
  import React from "react";
2
- export declare const Extension: () => React.JSX.Element;
2
+ export declare const Extension: () => React.JSX.Element | null;
@@ -1,5 +1,5 @@
1
1
  import react from "react";
2
- import { AdminConfig, AdminLayout, RegisterFeature, useRouter } from "@webiny/app-admin";
2
+ import { AdminConfig, AdminLayout, RegisterFeature, useFeatureFlags, useRouter } from "@webiny/app-admin";
3
3
  import { AiPowerUpsSettingsFeature } from "./presentation/AiPowerUpsSettings/index.js";
4
4
  import { AiPowerUpsSettingsPage } from "./presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js";
5
5
  import { WbContentGeneration } from "./presentation/WbContentGeneration/Extension.js";
@@ -33,13 +33,17 @@ const AiPowerUpsSettings = ()=>{
33
33
  })
34
34
  }));
35
35
  };
36
- const Extension = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(RegisterFeature, {
36
+ const Extension = ()=>{
37
+ const featureFlags = useFeatureFlags();
38
+ if (!featureFlags.isEnabled("aiPowerups")) return null;
39
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(RegisterFeature, {
37
40
  feature: AiPromptFormFeature
38
41
  }), /*#__PURE__*/ react.createElement(RegisterFeature, {
39
42
  feature: AiPowerUpsHeadlessFeatures
40
43
  }), /*#__PURE__*/ react.createElement(RegisterFeature, {
41
44
  feature: AiPowerUpsSettingsFeature
42
45
  }), /*#__PURE__*/ react.createElement(AiPowerUpsSettings, null), /*#__PURE__*/ react.createElement(WbContentGeneration, null), /*#__PURE__*/ react.createElement(CmsContentGeneration, null), /*#__PURE__*/ react.createElement(CmsCompareEntryRevisions, null), /*#__PURE__*/ react.createElement(CmsEntryWizardExtension, null));
46
+ };
43
47
  export { Extension };
44
48
 
45
49
  //# sourceMappingURL=Extension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin/Extension.js","sources":["../../src/admin/Extension.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig, AdminLayout, useRouter, RegisterFeature } from \"@webiny/app-admin\";\nimport { AiPowerUpsSettingsFeature } from \"./presentation/AiPowerUpsSettings/index.js\";\nimport { AiPowerUpsSettingsPage } from \"./presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js\";\nimport { WbContentGeneration } from \"~/admin/presentation/WbContentGeneration/Extension.js\";\nimport { CmsContentGeneration } from \"~/admin/presentation/CmsContentGeneration/Extension.js\";\nimport { CmsEntryWizardExtension } from \"~/admin/presentation/CmsEntryWizard/Extension.js\";\nimport { CmsCompareEntryRevisions } from \"~/admin/presentation/CmsCompareEntryRevisions/Extension.js\";\nimport { AiPowerUpsHeadlessFeatures } from \"~/admin/features/feature.js\";\nimport { AiPromptFormFeature } from \"~/admin/presentation/AiPromptFormFactory/feature.js\";\nimport { Routes } from \"./routes.js\";\n\nconst { Menu, Route } = AdminConfig;\n\nconst AiPowerUpsSettings = () => {\n const { getLink } = useRouter();\n\n return (\n <AdminConfig>\n <Route\n route={Routes.Settings}\n element={\n <AdminLayout title={\"AI Power-Ups\"}>\n <AdminConfig.Breadcrumb name={\"ai-powerups\"} label={\"AI Power-Ups\"} />\n <AiPowerUpsSettingsPage />\n </AdminLayout>\n }\n />\n <Menu\n parent={\"settings.system\"}\n name={\"aiPowerUps\"}\n element={\n <Menu.Link\n text={\"AI Power-Ups\"}\n badge={<Menu.Link.Badge text=\"BETA\" />}\n to={getLink(Routes.Settings)}\n pinnable={true}\n />\n }\n />\n </AdminConfig>\n );\n};\n\nexport const Extension = () => {\n return (\n <>\n <RegisterFeature feature={AiPromptFormFeature} />\n <RegisterFeature feature={AiPowerUpsHeadlessFeatures} />\n <RegisterFeature feature={AiPowerUpsSettingsFeature} />\n <AiPowerUpsSettings />\n {/* Website Builder Extension */}\n <WbContentGeneration />\n {/* Headless CMS Extension */}\n <CmsContentGeneration />\n {/* CMS Revision Comparison */}\n <CmsCompareEntryRevisions />\n {/* AI Entry Wizard (registered first so custom wizards can override) */}\n <CmsEntryWizardExtension />\n </>\n );\n};\n"],"names":["Menu","Route","AdminConfig","AiPowerUpsSettings","getLink","useRouter","Routes","AdminLayout","AiPowerUpsSettingsPage","Extension","RegisterFeature","AiPromptFormFeature","AiPowerUpsHeadlessFeatures","AiPowerUpsSettingsFeature","WbContentGeneration","CmsContentGeneration","CmsCompareEntryRevisions","CmsEntryWizardExtension"],"mappings":";;;;;;;;;;;AAYA,MAAM,EAAEA,MAAAA,IAAI,EAAEC,OAAAA,KAAK,EAAE,GAAGC;AAExB,MAAMC,qBAAqB;IACvB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,OAAO,WAAP,GACI,oBAACH,aAAWA,MAAAA,WAAAA,GACR,oBAACD,OAAKA;QACF,OAAOK,OAAO,QAAQ;QACtB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACL,YAAY,UAAU;YAAC,MAAM;YAAe,OAAO;0BACpD,oBAACM,wBAAsBA;sBAInC,oBAACR,MAAIA;QACD,QAAQ;QACR,MAAM;QACN,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,qBAAO,oBAACA,KAAK,IAAI,CAAC,KAAK;gBAAC,MAAK;;YAC7B,IAAII,QAAQE,OAAO,QAAQ;YAC3B,UAAU;;;AAMlC;AAEO,MAAMG,YAAY,IACd,WAAP,GACI,wDACI,oBAACC,iBAAeA;QAAC,SAASC;sBAC1B,oBAACD,iBAAeA;QAAC,SAASE;sBAC1B,oBAACF,iBAAeA;QAAC,SAASG;sBAC1B,oBAACV,oBAAkBA,OAAAA,WAAAA,GAEnB,oBAACW,qBAAmBA,OAAAA,WAAAA,GAEpB,oBAACC,sBAAoBA,OAAAA,WAAAA,GAErB,oBAACC,0BAAwBA,OAAAA,WAAAA,GAEzB,oBAACC,yBAAuBA"}
1
+ {"version":3,"file":"admin/Extension.js","sources":["../../src/admin/Extension.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n AdminConfig,\n AdminLayout,\n useRouter,\n RegisterFeature,\n useFeatureFlags\n} from \"@webiny/app-admin\";\nimport { AiPowerUpsSettingsFeature } from \"./presentation/AiPowerUpsSettings/index.js\";\nimport { AiPowerUpsSettingsPage } from \"./presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js\";\nimport { WbContentGeneration } from \"~/admin/presentation/WbContentGeneration/Extension.js\";\nimport { CmsContentGeneration } from \"~/admin/presentation/CmsContentGeneration/Extension.js\";\nimport { CmsEntryWizardExtension } from \"~/admin/presentation/CmsEntryWizard/Extension.js\";\nimport { CmsCompareEntryRevisions } from \"~/admin/presentation/CmsCompareEntryRevisions/Extension.js\";\nimport { AiPowerUpsHeadlessFeatures } from \"~/admin/features/feature.js\";\nimport { AiPromptFormFeature } from \"~/admin/presentation/AiPromptFormFactory/feature.js\";\nimport { Routes } from \"./routes.js\";\n\nconst { Menu, Route } = AdminConfig;\n\nconst AiPowerUpsSettings = () => {\n const { getLink } = useRouter();\n\n return (\n <AdminConfig>\n <Route\n route={Routes.Settings}\n element={\n <AdminLayout title={\"AI Power-Ups\"}>\n <AdminConfig.Breadcrumb name={\"ai-powerups\"} label={\"AI Power-Ups\"} />\n <AiPowerUpsSettingsPage />\n </AdminLayout>\n }\n />\n <Menu\n parent={\"settings.system\"}\n name={\"aiPowerUps\"}\n element={\n <Menu.Link\n text={\"AI Power-Ups\"}\n badge={<Menu.Link.Badge text=\"BETA\" />}\n to={getLink(Routes.Settings)}\n pinnable={true}\n />\n }\n />\n </AdminConfig>\n );\n};\n\nexport const Extension = () => {\n /*\n * Gated here rather than around `<Admin.Extension>` in `AiPowerups.tsx`, so a licence granted\n * after the last deploy takes effect on the next page load instead of the next deploy. Returning\n * null registers nothing, so an unlicensed project has no AI Power-Ups settings screen and no AI\n * buttons, rather than ones that fail when clicked. `app-audit-logs` gates the same way.\n */\n const featureFlags = useFeatureFlags();\n\n if (!featureFlags.isEnabled(\"aiPowerups\")) {\n return null;\n }\n\n return (\n <>\n <RegisterFeature feature={AiPromptFormFeature} />\n <RegisterFeature feature={AiPowerUpsHeadlessFeatures} />\n <RegisterFeature feature={AiPowerUpsSettingsFeature} />\n <AiPowerUpsSettings />\n {/* Website Builder Extension */}\n <WbContentGeneration />\n {/* Headless CMS Extension */}\n <CmsContentGeneration />\n {/* CMS Revision Comparison */}\n <CmsCompareEntryRevisions />\n {/* AI Entry Wizard (registered first so custom wizards can override) */}\n <CmsEntryWizardExtension />\n </>\n );\n};\n"],"names":["Menu","Route","AdminConfig","AiPowerUpsSettings","getLink","useRouter","Routes","AdminLayout","AiPowerUpsSettingsPage","Extension","featureFlags","useFeatureFlags","RegisterFeature","AiPromptFormFeature","AiPowerUpsHeadlessFeatures","AiPowerUpsSettingsFeature","WbContentGeneration","CmsContentGeneration","CmsCompareEntryRevisions","CmsEntryWizardExtension"],"mappings":";;;;;;;;;;;AAkBA,MAAM,EAAEA,MAAAA,IAAI,EAAEC,OAAAA,KAAK,EAAE,GAAGC;AAExB,MAAMC,qBAAqB;IACvB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,OAAO,WAAP,GACI,oBAACH,aAAWA,MAAAA,WAAAA,GACR,oBAACD,OAAKA;QACF,OAAOK,OAAO,QAAQ;QACtB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACL,YAAY,UAAU;YAAC,MAAM;YAAe,OAAO;0BACpD,oBAACM,wBAAsBA;sBAInC,oBAACR,MAAIA;QACD,QAAQ;QACR,MAAM;QACN,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,qBAAO,oBAACA,KAAK,IAAI,CAAC,KAAK;gBAAC,MAAK;;YAC7B,IAAII,QAAQE,OAAO,QAAQ;YAC3B,UAAU;;;AAMlC;AAEO,MAAMG,YAAY;IAOrB,MAAMC,eAAeC;IAErB,IAAI,CAACD,aAAa,SAAS,CAAC,eACxB,OAAO;IAGX,OAAO,WAAP,GACI,wDACI,oBAACE,iBAAeA;QAAC,SAASC;sBAC1B,oBAACD,iBAAeA;QAAC,SAASE;sBAC1B,oBAACF,iBAAeA;QAAC,SAASG;sBAC1B,oBAACZ,oBAAkBA,OAAAA,WAAAA,GAEnB,oBAACa,qBAAmBA,OAAAA,WAAAA,GAEpB,oBAACC,sBAAoBA,OAAAA,WAAAA,GAErB,oBAACC,0BAAwBA,OAAAA,WAAAA,GAEzB,oBAACC,yBAAuBA;AAGpC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The model role ids, admin-side.
3
+ *
4
+ * A closed set by design: an extension can add a capability, never a role. That is why this is a
5
+ * record keyed by id everywhere it appears rather than a list — three named slots, not a collection
6
+ * someone appends to.
7
+ *
8
+ * The api owns the ids and the resolution rules (`~/api/features/ModelRoles/roles.ts`). They are
9
+ * repeated here rather than imported because admin and api are separate bundles and nothing else in
10
+ * `src/admin` reaches across that line; settings section names are already duplicated the same way.
11
+ *
12
+ * This lives in `domain` rather than next to the settings form so `features/` can use it without
13
+ * importing from `presentation/`. The labels and descriptions stay in
14
+ * `~/admin/presentation/modelRoles.js`, since those are words on a screen.
15
+ */
16
+ export declare const AI_MODEL_ROLE_IDS: readonly ["fast", "standard", "vision"];
17
+ export type AiModelRoleId = (typeof AI_MODEL_ROLE_IDS)[number];
@@ -0,0 +1,8 @@
1
+ const AI_MODEL_ROLE_IDS = [
2
+ "fast",
3
+ "standard",
4
+ "vision"
5
+ ];
6
+ export { AI_MODEL_ROLE_IDS };
7
+
8
+ //# sourceMappingURL=modelRoles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/domain/modelRoles.js","sources":["../../../src/admin/domain/modelRoles.ts"],"sourcesContent":["/**\n * The model role ids, admin-side.\n *\n * A closed set by design: an extension can add a capability, never a role. That is why this is a\n * record keyed by id everywhere it appears rather than a list — three named slots, not a collection\n * someone appends to.\n *\n * The api owns the ids and the resolution rules (`~/api/features/ModelRoles/roles.ts`). They are\n * repeated here rather than imported because admin and api are separate bundles and nothing else in\n * `src/admin` reaches across that line; settings section names are already duplicated the same way.\n *\n * This lives in `domain` rather than next to the settings form so `features/` can use it without\n * importing from `presentation/`. The labels and descriptions stay in\n * `~/admin/presentation/modelRoles.js`, since those are words on a screen.\n */\nexport const AI_MODEL_ROLE_IDS = [\"fast\", \"standard\", \"vision\"] as const;\n\nexport type AiModelRoleId = (typeof AI_MODEL_ROLE_IDS)[number];\n"],"names":["AI_MODEL_ROLE_IDS"],"mappings":"AAeO,MAAMA,oBAAoB;IAAC;IAAQ;IAAY;CAAS"}
@@ -1,5 +1,6 @@
1
1
  import { createFeature } from "@webiny/feature/admin";
2
2
  import { ListModelsFeature } from "./listModels/index.js";
3
+ import { ListCapabilitiesFeature } from "./listCapabilities/index.js";
3
4
  import { SharedSettingsFeature } from "./settings/shared/index.js";
4
5
  import { GetSettingsFeature } from "./settings/getSettings/index.js";
5
6
  import { UpdateSettingsFeature } from "./settings/updateSettings/index.js";
@@ -12,6 +13,7 @@ const AiPowerUpsHeadlessFeatures = createFeature({
12
13
  GetSettingsFeature.register(container);
13
14
  UpdateSettingsFeature.register(container);
14
15
  ListModelsFeature.register(container);
16
+ ListCapabilitiesFeature.register(container);
15
17
  GeneratePageContentFeature.register(container);
16
18
  CompareEntryRevisionsFeature.register(container);
17
19
  },
@@ -1 +1 @@
1
- {"version":3,"file":"admin/features/feature.js","sources":["../../../src/admin/features/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ListModelsFeature } from \"~/admin/features/listModels/index.js\";\nimport { SharedSettingsFeature } from \"~/admin/features/settings/shared/index.js\";\nimport { GetSettingsFeature } from \"~/admin/features/settings/getSettings/index.js\";\nimport { UpdateSettingsFeature } from \"~/admin/features/settings/updateSettings/index.js\";\nimport { GeneratePageContentFeature } from \"~/admin/features/generatePageContent/index.js\";\nimport { CompareEntryRevisionsFeature } from \"~/admin/features/compareEntryRevisions/index.js\";\n\nexport const AiPowerUpsHeadlessFeatures = createFeature({\n name: \"AiPowerUps/HeadlessFeatures\",\n register(container) {\n SharedSettingsFeature.register(container);\n GetSettingsFeature.register(container);\n UpdateSettingsFeature.register(container);\n ListModelsFeature.register(container);\n GeneratePageContentFeature.register(container);\n CompareEntryRevisionsFeature.register(container);\n },\n resolve() {\n return {};\n }\n});\n"],"names":["AiPowerUpsHeadlessFeatures","createFeature","container","SharedSettingsFeature","GetSettingsFeature","UpdateSettingsFeature","ListModelsFeature","GeneratePageContentFeature","CompareEntryRevisionsFeature"],"mappings":";;;;;;;AAQO,MAAMA,6BAA6BC,cAAc;IACpD,MAAM;IACN,UAASC,SAAS;QACdC,sBAAsB,QAAQ,CAACD;QAC/BE,mBAAmB,QAAQ,CAACF;QAC5BG,sBAAsB,QAAQ,CAACH;QAC/BI,kBAAkB,QAAQ,CAACJ;QAC3BK,2BAA2B,QAAQ,CAACL;QACpCM,6BAA6B,QAAQ,CAACN;IAC1C;IACA;QACI,OAAO,CAAC;IACZ;AACJ"}
1
+ {"version":3,"file":"admin/features/feature.js","sources":["../../../src/admin/features/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ListModelsFeature } from \"~/admin/features/listModels/index.js\";\nimport { ListCapabilitiesFeature } from \"~/admin/features/listCapabilities/index.js\";\nimport { SharedSettingsFeature } from \"~/admin/features/settings/shared/index.js\";\nimport { GetSettingsFeature } from \"~/admin/features/settings/getSettings/index.js\";\nimport { UpdateSettingsFeature } from \"~/admin/features/settings/updateSettings/index.js\";\nimport { GeneratePageContentFeature } from \"~/admin/features/generatePageContent/index.js\";\nimport { CompareEntryRevisionsFeature } from \"~/admin/features/compareEntryRevisions/index.js\";\n\nexport const AiPowerUpsHeadlessFeatures = createFeature({\n name: \"AiPowerUps/HeadlessFeatures\",\n register(container) {\n SharedSettingsFeature.register(container);\n GetSettingsFeature.register(container);\n UpdateSettingsFeature.register(container);\n ListModelsFeature.register(container);\n ListCapabilitiesFeature.register(container);\n GeneratePageContentFeature.register(container);\n CompareEntryRevisionsFeature.register(container);\n },\n resolve() {\n return {};\n }\n});\n"],"names":["AiPowerUpsHeadlessFeatures","createFeature","container","SharedSettingsFeature","GetSettingsFeature","UpdateSettingsFeature","ListModelsFeature","ListCapabilitiesFeature","GeneratePageContentFeature","CompareEntryRevisionsFeature"],"mappings":";;;;;;;;AASO,MAAMA,6BAA6BC,cAAc;IACpD,MAAM;IACN,UAASC,SAAS;QACdC,sBAAsB,QAAQ,CAACD;QAC/BE,mBAAmB,QAAQ,CAACF;QAC5BG,sBAAsB,QAAQ,CAACH;QAC/BI,kBAAkB,QAAQ,CAACJ;QAC3BK,wBAAwB,QAAQ,CAACL;QACjCM,2BAA2B,QAAQ,CAACN;QACpCO,6BAA6B,QAAQ,CAACP;IAC1C;IACA;QACI,OAAO,CAAC;IACZ;AACJ"}
@@ -0,0 +1,12 @@
1
+ import { MainGraphQLClient } from "@webiny/app/exports/admin.js";
2
+ import { ListCapabilitiesGateway as GatewayAbstraction } from "./abstractions.js";
3
+ import type { AiCapability } from "./abstractions.js";
4
+ declare class ListCapabilitiesGatewayImpl implements GatewayAbstraction.Interface {
5
+ private client;
6
+ constructor(client: MainGraphQLClient.Interface);
7
+ execute(): Promise<AiCapability[]>;
8
+ }
9
+ export declare const ListCapabilitiesGateway: typeof ListCapabilitiesGatewayImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListCapabilitiesGateway>;
11
+ };
12
+ export {};
@@ -0,0 +1,34 @@
1
+ import { MainGraphQLClient } from "@webiny/app/exports/admin.js";
2
+ import { ListCapabilitiesGateway } from "./abstractions.js";
3
+ const LIST_CAPABILITIES = `
4
+ query ListAiCapabilities {
5
+ aiPowerUps {
6
+ listCapabilities {
7
+ id
8
+ label
9
+ description
10
+ defaultRole
11
+ }
12
+ }
13
+ }
14
+ `;
15
+ class ListCapabilitiesGatewayImpl {
16
+ constructor(client){
17
+ this.client = client;
18
+ }
19
+ async execute() {
20
+ const response = await this.client.execute({
21
+ query: LIST_CAPABILITIES
22
+ });
23
+ return response.aiPowerUps.listCapabilities ?? [];
24
+ }
25
+ }
26
+ const ListCapabilitiesGateway_ListCapabilitiesGateway = ListCapabilitiesGateway.createImplementation({
27
+ implementation: ListCapabilitiesGatewayImpl,
28
+ dependencies: [
29
+ MainGraphQLClient
30
+ ]
31
+ });
32
+ export { ListCapabilitiesGateway_ListCapabilitiesGateway as ListCapabilitiesGateway };
33
+
34
+ //# sourceMappingURL=ListCapabilitiesGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/listCapabilities/ListCapabilitiesGateway.js","sources":["../../../../src/admin/features/listCapabilities/ListCapabilitiesGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/exports/admin.js\";\nimport { ListCapabilitiesGateway as GatewayAbstraction } from \"./abstractions.js\";\nimport type { AiCapability } from \"./abstractions.js\";\n\nconst LIST_CAPABILITIES = /* GraphQL */ `\n query ListAiCapabilities {\n aiPowerUps {\n listCapabilities {\n id\n label\n description\n defaultRole\n }\n }\n }\n`;\n\ntype ListCapabilitiesResponse = {\n aiPowerUps: {\n listCapabilities: AiCapability[];\n };\n};\n\nclass ListCapabilitiesGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(): Promise<AiCapability[]> {\n const response = await this.client.execute<ListCapabilitiesResponse>({\n query: LIST_CAPABILITIES\n });\n\n return response.aiPowerUps.listCapabilities ?? [];\n }\n}\n\nexport const ListCapabilitiesGateway = GatewayAbstraction.createImplementation({\n implementation: ListCapabilitiesGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["LIST_CAPABILITIES","ListCapabilitiesGatewayImpl","client","response","ListCapabilitiesGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;AAIA,MAAMA,oBAAkC,CAAC;;;;;;;;;;;AAWzC,CAAC;AAQD,MAAMC;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,UAAmC;QACrC,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA2B;YACjE,OAAOH;QACX;QAEA,OAAOG,SAAS,UAAU,CAAC,gBAAgB,IAAI,EAAE;IACrD;AACJ;AAEO,MAAMC,kDAA0BC,wBAAAA,oBAAuC,CAAC;IAC3E,gBAAgBJ;IAChB,cAAc;QAACK;KAAkB;AACrC"}
@@ -0,0 +1,13 @@
1
+ import { ListCapabilitiesRepository as RepoAbstraction, ListCapabilitiesGateway } from "./abstractions.js";
2
+ import type { AiCapability } from "./abstractions.js";
3
+ declare class ListCapabilitiesRepositoryImpl implements RepoAbstraction.Interface {
4
+ private gateway;
5
+ private capabilities;
6
+ constructor(gateway: ListCapabilitiesGateway.Interface);
7
+ execute(): Promise<void>;
8
+ getCapabilities(): AiCapability[];
9
+ }
10
+ export declare const ListCapabilitiesRepository: typeof ListCapabilitiesRepositoryImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListCapabilitiesRepository>;
12
+ };
13
+ export {};
@@ -0,0 +1,27 @@
1
+ import { makeAutoObservable, runInAction } from "mobx";
2
+ import { ListCapabilitiesGateway, ListCapabilitiesRepository } from "./abstractions.js";
3
+ class ListCapabilitiesRepositoryImpl {
4
+ constructor(gateway){
5
+ this.gateway = gateway;
6
+ this.capabilities = [];
7
+ makeAutoObservable(this);
8
+ }
9
+ async execute() {
10
+ const capabilities = await this.gateway.execute();
11
+ runInAction(()=>{
12
+ this.capabilities = capabilities;
13
+ });
14
+ }
15
+ getCapabilities() {
16
+ return this.capabilities;
17
+ }
18
+ }
19
+ const ListCapabilitiesRepository_ListCapabilitiesRepository = ListCapabilitiesRepository.createImplementation({
20
+ implementation: ListCapabilitiesRepositoryImpl,
21
+ dependencies: [
22
+ ListCapabilitiesGateway
23
+ ]
24
+ });
25
+ export { ListCapabilitiesRepository_ListCapabilitiesRepository as ListCapabilitiesRepository };
26
+
27
+ //# sourceMappingURL=ListCapabilitiesRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/listCapabilities/ListCapabilitiesRepository.js","sources":["../../../../src/admin/features/listCapabilities/ListCapabilitiesRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport {\n ListCapabilitiesRepository as RepoAbstraction,\n ListCapabilitiesGateway\n} from \"./abstractions.js\";\nimport type { AiCapability } from \"./abstractions.js\";\n\nclass ListCapabilitiesRepositoryImpl implements RepoAbstraction.Interface {\n private capabilities: AiCapability[] = [];\n\n constructor(private gateway: ListCapabilitiesGateway.Interface) {\n makeAutoObservable(this);\n }\n\n async execute(): Promise<void> {\n const capabilities = await this.gateway.execute();\n runInAction(() => {\n this.capabilities = capabilities;\n });\n }\n\n getCapabilities(): AiCapability[] {\n return this.capabilities;\n }\n}\n\nexport const ListCapabilitiesRepository = RepoAbstraction.createImplementation({\n implementation: ListCapabilitiesRepositoryImpl,\n dependencies: [ListCapabilitiesGateway]\n});\n"],"names":["ListCapabilitiesRepositoryImpl","gateway","makeAutoObservable","capabilities","runInAction","ListCapabilitiesRepository","RepoAbstraction","ListCapabilitiesGateway"],"mappings":";;AAOA,MAAMA;IAGF,YAAoBC,OAA0C,CAAE;aAA5CA,OAAO,GAAPA;aAFZ,YAAY,GAAmB,EAAE;QAGrCC,mBAAmB,IAAI;IAC3B;IAEA,MAAM,UAAyB;QAC3B,MAAMC,eAAe,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO;QAC/CC,YAAY;YACR,IAAI,CAAC,YAAY,GAAGD;QACxB;IACJ;IAEA,kBAAkC;QAC9B,OAAO,IAAI,CAAC,YAAY;IAC5B;AACJ;AAEO,MAAME,wDAA6BC,2BAAAA,oBAAoC,CAAC;IAC3E,gBAAgBN;IAChB,cAAc;QAACO;KAAwB;AAC3C"}
@@ -0,0 +1,10 @@
1
+ import { ListCapabilitiesUseCase as UseCaseAbstraction, ListCapabilitiesRepository } from "./abstractions.js";
2
+ declare class ListCapabilitiesUseCaseImpl implements UseCaseAbstraction.Interface {
3
+ private repository;
4
+ constructor(repository: ListCapabilitiesRepository.Interface);
5
+ execute(): Promise<void>;
6
+ }
7
+ export declare const ListCapabilitiesUseCase: typeof ListCapabilitiesUseCaseImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListCapabilitiesUseCase>;
9
+ };
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ListCapabilitiesRepository, ListCapabilitiesUseCase } from "./abstractions.js";
2
+ class ListCapabilitiesUseCaseImpl {
3
+ constructor(repository){
4
+ this.repository = repository;
5
+ }
6
+ async execute() {
7
+ return this.repository.execute();
8
+ }
9
+ }
10
+ const ListCapabilitiesUseCase_ListCapabilitiesUseCase = ListCapabilitiesUseCase.createImplementation({
11
+ implementation: ListCapabilitiesUseCaseImpl,
12
+ dependencies: [
13
+ ListCapabilitiesRepository
14
+ ]
15
+ });
16
+ export { ListCapabilitiesUseCase_ListCapabilitiesUseCase as ListCapabilitiesUseCase };
17
+
18
+ //# sourceMappingURL=ListCapabilitiesUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/listCapabilities/ListCapabilitiesUseCase.js","sources":["../../../../src/admin/features/listCapabilities/ListCapabilitiesUseCase.ts"],"sourcesContent":["import {\n ListCapabilitiesUseCase as UseCaseAbstraction,\n ListCapabilitiesRepository\n} from \"./abstractions.js\";\n\nclass ListCapabilitiesUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private repository: ListCapabilitiesRepository.Interface) {}\n\n async execute(): Promise<void> {\n return this.repository.execute();\n }\n}\n\nexport const ListCapabilitiesUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListCapabilitiesUseCaseImpl,\n dependencies: [ListCapabilitiesRepository]\n});\n"],"names":["ListCapabilitiesUseCaseImpl","repository","ListCapabilitiesUseCase","UseCaseAbstraction","ListCapabilitiesRepository"],"mappings":";AAKA,MAAMA;IACF,YAAoBC,UAAgD,CAAE;aAAlDA,UAAU,GAAVA;IAAmD;IAEvE,MAAM,UAAyB;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO;IAClC;AACJ;AAEO,MAAMC,kDAA0BC,wBAAAA,oBAAuC,CAAC;IAC3E,gBAAgBH;IAChB,cAAc;QAACI;KAA2B;AAC9C"}
@@ -0,0 +1,28 @@
1
+ export interface AiCapability {
2
+ id: string;
3
+ label: string;
4
+ description: string;
5
+ defaultRole: string;
6
+ }
7
+ export interface IListCapabilitiesGateway {
8
+ execute(): Promise<AiCapability[]>;
9
+ }
10
+ export declare const ListCapabilitiesGateway: import("@webiny/di").Abstraction<IListCapabilitiesGateway>;
11
+ export declare namespace ListCapabilitiesGateway {
12
+ type Interface = IListCapabilitiesGateway;
13
+ }
14
+ export interface IListCapabilitiesRepository {
15
+ execute(): Promise<void>;
16
+ getCapabilities(): AiCapability[];
17
+ }
18
+ export declare const ListCapabilitiesRepository: import("@webiny/di").Abstraction<IListCapabilitiesRepository>;
19
+ export declare namespace ListCapabilitiesRepository {
20
+ type Interface = IListCapabilitiesRepository;
21
+ }
22
+ export interface IListCapabilitiesUseCase {
23
+ execute(): Promise<void>;
24
+ }
25
+ export declare const ListCapabilitiesUseCase: import("@webiny/di").Abstraction<IListCapabilitiesUseCase>;
26
+ export declare namespace ListCapabilitiesUseCase {
27
+ type Interface = IListCapabilitiesUseCase;
28
+ }
@@ -0,0 +1,7 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const ListCapabilitiesGateway = createAbstraction("AiPowerUps/ListCapabilitiesGateway");
3
+ const ListCapabilitiesRepository = createAbstraction("AiPowerUps/ListCapabilitiesRepository");
4
+ const ListCapabilitiesUseCase = createAbstraction("AiPowerUps/ListCapabilitiesUseCase");
5
+ export { ListCapabilitiesGateway, ListCapabilitiesRepository, ListCapabilitiesUseCase };
6
+
7
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/listCapabilities/abstractions.js","sources":["../../../../src/admin/features/listCapabilities/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface AiCapability {\n id: string;\n label: string;\n description: string;\n defaultRole: string;\n}\n\nexport interface IListCapabilitiesGateway {\n execute(): Promise<AiCapability[]>;\n}\n\nexport const ListCapabilitiesGateway = createAbstraction<IListCapabilitiesGateway>(\n \"AiPowerUps/ListCapabilitiesGateway\"\n);\nexport namespace ListCapabilitiesGateway {\n export type Interface = IListCapabilitiesGateway;\n}\n\nexport interface IListCapabilitiesRepository {\n execute(): Promise<void>;\n getCapabilities(): AiCapability[];\n}\n\nexport const ListCapabilitiesRepository = createAbstraction<IListCapabilitiesRepository>(\n \"AiPowerUps/ListCapabilitiesRepository\"\n);\nexport namespace ListCapabilitiesRepository {\n export type Interface = IListCapabilitiesRepository;\n}\n\nexport interface IListCapabilitiesUseCase {\n execute(): Promise<void>;\n}\n\nexport const ListCapabilitiesUseCase = createAbstraction<IListCapabilitiesUseCase>(\n \"AiPowerUps/ListCapabilitiesUseCase\"\n);\nexport namespace ListCapabilitiesUseCase {\n export type Interface = IListCapabilitiesUseCase;\n}\n"],"names":["ListCapabilitiesGateway","createAbstraction","ListCapabilitiesRepository","ListCapabilitiesUseCase"],"mappings":";AAaO,MAAMA,0BAA0BC,kBACnC;AAWG,MAAMC,6BAA6BD,kBACtC;AAUG,MAAME,0BAA0BF,kBACnC"}
@@ -0,0 +1,3 @@
1
+ export declare const ListCapabilitiesFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ useCase: import("./abstractions.js").IListCapabilitiesUseCase;
3
+ }, []>;
@@ -0,0 +1,21 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { ListCapabilitiesUseCase } from "./abstractions.js";
3
+ import { ListCapabilitiesUseCase as external_ListCapabilitiesUseCase_js_ListCapabilitiesUseCase } from "./ListCapabilitiesUseCase.js";
4
+ import { ListCapabilitiesRepository } from "./ListCapabilitiesRepository.js";
5
+ import { ListCapabilitiesGateway } from "./ListCapabilitiesGateway.js";
6
+ const ListCapabilitiesFeature = createFeature({
7
+ name: "AiPowerUps/ListCapabilities",
8
+ register (container) {
9
+ container.register(external_ListCapabilitiesUseCase_js_ListCapabilitiesUseCase);
10
+ container.register(ListCapabilitiesRepository).inSingletonScope();
11
+ container.register(ListCapabilitiesGateway).inSingletonScope();
12
+ },
13
+ resolve (container) {
14
+ return {
15
+ useCase: container.resolve(ListCapabilitiesUseCase)
16
+ };
17
+ }
18
+ });
19
+ export { ListCapabilitiesFeature };
20
+
21
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/listCapabilities/feature.js","sources":["../../../../src/admin/features/listCapabilities/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ListCapabilitiesUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { ListCapabilitiesUseCase } from \"./ListCapabilitiesUseCase.js\";\nimport { ListCapabilitiesRepository } from \"./ListCapabilitiesRepository.js\";\nimport { ListCapabilitiesGateway } from \"./ListCapabilitiesGateway.js\";\n\nexport const ListCapabilitiesFeature = createFeature({\n name: \"AiPowerUps/ListCapabilities\",\n register(container) {\n container.register(ListCapabilitiesUseCase);\n container.register(ListCapabilitiesRepository).inSingletonScope();\n container.register(ListCapabilitiesGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCaseAbstraction)\n };\n }\n});\n"],"names":["ListCapabilitiesFeature","createFeature","container","ListCapabilitiesUseCase","ListCapabilitiesRepository","ListCapabilitiesGateway","UseCaseAbstraction"],"mappings":";;;;;AAMO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,4BAA4B,gBAAgB;QAC/DF,UAAU,QAAQ,CAACG,yBAAyB,gBAAgB;IAChE;IACA,SAAQH,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACI;QAC/B;IACJ;AACJ"}
@@ -0,0 +1,3 @@
1
+ export { ListCapabilitiesFeature } from "./feature.js";
2
+ export { ListCapabilitiesUseCase, ListCapabilitiesRepository, ListCapabilitiesGateway } from "./abstractions.js";
3
+ export type { AiCapability } from "./abstractions.js";
@@ -0,0 +1,2 @@
1
+ export { ListCapabilitiesFeature } from "./feature.js";
2
+ export { ListCapabilitiesGateway, ListCapabilitiesRepository, ListCapabilitiesUseCase } from "./abstractions.js";
@@ -1,3 +1,4 @@
1
+ import type { AiModelRoleId } from "../../../../admin/domain/modelRoles.js";
1
2
  export interface IAiPowerUpsSettingsCache {
2
3
  get(): IAiPowerUpsSettings | null;
3
4
  set(data: IAiPowerUpsSettings): void;
@@ -12,14 +13,63 @@ export interface IAiPowerUpsPersonaPreset {
12
13
  description: string;
13
14
  style?: string;
14
15
  }
16
+ /** One vendor credential. The `apiKey` is only ever the mask; the plaintext never leaves the api. */
17
+ export interface IAiPowerUpsConnectionPreset {
18
+ id: string;
19
+ name: string;
20
+ sdkName: string;
21
+ apiKey: string;
22
+ }
23
+ export interface IAiPowerUpsModelRoleAssignment {
24
+ connectionId: string;
25
+ model: string;
26
+ }
27
+ /** A file attached to a project, as the picker returns it. */
28
+ export interface IAiPowerUpsProjectFile {
29
+ id: string;
30
+ name: string;
31
+ size: number;
32
+ mimeType: string;
33
+ src: string;
34
+ width?: number;
35
+ height?: number;
36
+ }
37
+ export interface IAiPowerUpsProjectPreset {
38
+ id: string;
39
+ name: string;
40
+ description?: string;
41
+ instructions?: string;
42
+ defaultReaderPersonaId?: string;
43
+ defaultWriterPersonaId?: string;
44
+ files?: IAiPowerUpsProjectFile[];
45
+ version: number;
46
+ }
47
+ /** What a project decided about one capability. Absent `enabled` means enabled. */
48
+ export interface IAiPowerUpsCapabilityEntry {
49
+ enabled?: boolean;
50
+ overrides: IAiPowerUpsCapabilityOverride;
51
+ }
52
+ export interface IAiPowerUpsCapabilityOverride {
53
+ roleId?: string;
54
+ connectionId?: string;
55
+ model?: string;
56
+ additionalInstructions?: string;
57
+ }
15
58
  export interface IAiPowerUpsSettings {
16
- providers: {
17
- presets: {
18
- name: string;
19
- description: string;
20
- model: string;
21
- apiKey: string;
22
- }[];
59
+ connections: {
60
+ presets: IAiPowerUpsConnectionPreset[];
61
+ };
62
+ modelRoles: {
63
+ /** Keyed by role id, and every role always present — the set is closed. */
64
+ roles: Record<AiModelRoleId, IAiPowerUpsModelRoleAssignment>;
65
+ };
66
+ capabilities: {
67
+ /**
68
+ * Keyed by capability id, and open-ended: extensions register their own, so there is no
69
+ * union to enumerate. `Partial` because most capabilities are untouched, and a bare
70
+ * `Record` would type a miss as present.
71
+ */
72
+ items: Partial<Record<string, IAiPowerUpsCapabilityEntry>>;
23
73
  };
24
74
  readerPersonas: {
25
75
  presets: IAiPowerUpsPersonaPreset[];
@@ -28,23 +78,6 @@ export interface IAiPowerUpsSettings {
28
78
  presets: IAiPowerUpsPersonaPreset[];
29
79
  };
30
80
  projects: {
31
- presets: {
32
- id: string;
33
- name: string;
34
- description?: string;
35
- instructions?: string;
36
- defaultReaderPersonaId?: string;
37
- defaultWriterPersonaId?: string;
38
- files?: {
39
- id: string;
40
- name: string;
41
- size: number;
42
- mimeType: string;
43
- src: string;
44
- width?: number;
45
- height?: number;
46
- }[];
47
- version: number;
48
- }[];
81
+ presets: IAiPowerUpsProjectPreset[];
49
82
  };
50
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"admin/features/settings/shared/abstractions.js","sources":["../../../../../src/admin/features/settings/shared/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface IAiPowerUpsSettingsCache {\n get(): IAiPowerUpsSettings | null;\n set(data: IAiPowerUpsSettings): void;\n}\n\nexport const SettingsCache = createAbstraction<IAiPowerUpsSettingsCache>(\n \"AiPowerUps/SettingsCache\"\n);\nexport namespace SettingsCache {\n export type Interface = IAiPowerUpsSettingsCache;\n}\n\nexport interface IAiPowerUpsPersonaPreset {\n id: string;\n name: string;\n description: string;\n style?: string;\n}\n\nexport interface IAiPowerUpsSettings {\n providers: {\n presets: {\n name: string;\n description: string;\n model: string;\n apiKey: string;\n }[];\n };\n readerPersonas: {\n presets: IAiPowerUpsPersonaPreset[];\n };\n writerPersonas: {\n presets: IAiPowerUpsPersonaPreset[];\n };\n projects: {\n presets: {\n id: string;\n name: string;\n description?: string;\n instructions?: string;\n defaultReaderPersonaId?: string;\n defaultWriterPersonaId?: string;\n files?: {\n id: string;\n name: string;\n size: number;\n mimeType: string;\n src: string;\n width?: number;\n height?: number;\n }[];\n version: number;\n }[];\n };\n}\n"],"names":["SettingsCache","createAbstraction"],"mappings":";AAOO,MAAMA,gBAAgBC,kBACzB"}
1
+ {"version":3,"file":"admin/features/settings/shared/abstractions.js","sources":["../../../../../src/admin/features/settings/shared/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { AiModelRoleId } from \"~/admin/domain/modelRoles.js\";\n\nexport interface IAiPowerUpsSettingsCache {\n get(): IAiPowerUpsSettings | null;\n set(data: IAiPowerUpsSettings): void;\n}\n\nexport const SettingsCache = createAbstraction<IAiPowerUpsSettingsCache>(\n \"AiPowerUps/SettingsCache\"\n);\nexport namespace SettingsCache {\n export type Interface = IAiPowerUpsSettingsCache;\n}\n\nexport interface IAiPowerUpsPersonaPreset {\n id: string;\n name: string;\n description: string;\n style?: string;\n}\n\n/** One vendor credential. The `apiKey` is only ever the mask; the plaintext never leaves the api. */\nexport interface IAiPowerUpsConnectionPreset {\n id: string;\n name: string;\n sdkName: string;\n apiKey: string;\n}\n\nexport interface IAiPowerUpsModelRoleAssignment {\n connectionId: string;\n model: string;\n}\n\n/** A file attached to a project, as the picker returns it. */\nexport interface IAiPowerUpsProjectFile {\n id: string;\n name: string;\n size: number;\n mimeType: string;\n src: string;\n width?: number;\n height?: number;\n}\n\nexport interface IAiPowerUpsProjectPreset {\n id: string;\n name: string;\n description?: string;\n instructions?: string;\n defaultReaderPersonaId?: string;\n defaultWriterPersonaId?: string;\n files?: IAiPowerUpsProjectFile[];\n version: number;\n}\n\n/** What a project decided about one capability. Absent `enabled` means enabled. */\nexport interface IAiPowerUpsCapabilityEntry {\n enabled?: boolean;\n overrides: IAiPowerUpsCapabilityOverride;\n}\n\nexport interface IAiPowerUpsCapabilityOverride {\n roleId?: string;\n connectionId?: string;\n model?: string;\n additionalInstructions?: string;\n}\n\nexport interface IAiPowerUpsSettings {\n connections: {\n presets: IAiPowerUpsConnectionPreset[];\n };\n modelRoles: {\n /** Keyed by role id, and every role always present — the set is closed. */\n roles: Record<AiModelRoleId, IAiPowerUpsModelRoleAssignment>;\n };\n capabilities: {\n /**\n * Keyed by capability id, and open-ended: extensions register their own, so there is no\n * union to enumerate. `Partial` because most capabilities are untouched, and a bare\n * `Record` would type a miss as present.\n */\n items: Partial<Record<string, IAiPowerUpsCapabilityEntry>>;\n };\n readerPersonas: {\n presets: IAiPowerUpsPersonaPreset[];\n };\n writerPersonas: {\n presets: IAiPowerUpsPersonaPreset[];\n };\n projects: {\n presets: IAiPowerUpsProjectPreset[];\n };\n}\n"],"names":["SettingsCache","createAbstraction"],"mappings":";AAQO,MAAMA,gBAAgBC,kBACzB"}
@@ -33,8 +33,20 @@ class AiPowerUpsSettingsPresenterImpl {
33
33
  this.loading = true;
34
34
  this.errors = [];
35
35
  try {
36
- const data = await this.getSettings.execute();
36
+ const [data, initResults] = await Promise.all([
37
+ this.getSettings.execute(),
38
+ Promise.allSettled(this.groups.map((group)=>group.init?.()))
39
+ ]);
40
+ const initErrors = initResults.flatMap((result, index)=>{
41
+ if ("rejected" !== result.status) return [];
42
+ const label = this.groups[index].label;
43
+ const reason = result.reason instanceof Error ? result.reason.message : String(result.reason);
44
+ return [
45
+ `Could not load the "${label}" section: ${reason}`
46
+ ];
47
+ });
37
48
  runInAction(()=>{
49
+ this.errors = initErrors;
38
50
  this.form = this.buildForm();
39
51
  this.form.setData(data);
40
52
  });
@@ -1 +1 @@
1
- {"version":3,"file":"admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.js","sources":["../../../../src/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.ts"],"sourcesContent":["import { makeAutoObservable, computed, runInAction } from \"mobx\";\nimport { FormModelFactory, FormModel } from \"@webiny/app-admin\";\nimport type { ILayoutNodeBuilder } from \"@webiny/app-admin/features/formModel/abstractions.js\";\nimport { GetSettingsUseCase } from \"../../features/settings/getSettings/abstractions.js\";\nimport { UpdateSettingsUseCase } from \"../../features/settings/updateSettings/abstractions.js\";\nimport { AiPowerUpsSettingsPresenter as PresenterAbstraction } from \"./abstractions.js\";\nimport { AiPowerUpsSettingsGroup } from \"./settingsGroup.js\";\nimport { SettingsValidationError } from \"~/admin/domain/errors.js\";\nimport type { IAiPowerUpsSettings } from \"~/admin/features/settings/shared/abstractions.js\";\n\ntype FieldsFactory = (\n fields: FormModelFactory.FieldBuilderRegistry\n) => Record<string, FormModelFactory.FieldBuilder>;\n\ntype LayoutFactory = (layout: FormModelFactory.LayoutBuilder) => ILayoutNodeBuilder[];\n\ninterface CollectedGroup {\n group: AiPowerUpsSettingsGroup.Interface;\n fieldsFn: FieldsFactory | null;\n layoutFn: LayoutFactory | null;\n}\n\nclass AiPowerUpsSettingsPresenterImpl implements PresenterAbstraction.Interface {\n private loading = false;\n private saving = false;\n private form: FormModel.Interface<IAiPowerUpsSettings> | null = null;\n private errors: string[] = [];\n\n constructor(\n private factory: FormModelFactory.Interface,\n private groups: AiPowerUpsSettingsGroup.Interface[],\n private getSettings: GetSettingsUseCase.Interface,\n private updateSettings: UpdateSettingsUseCase.Interface\n ) {\n makeAutoObservable(this, { vm: computed }, { autoBind: true });\n }\n\n get vm(): PresenterAbstraction.ViewModel {\n return {\n loading: this.loading,\n saving: this.saving,\n form: this.form ? this.form.vm : null,\n errors: this.errors\n };\n }\n\n async init(): Promise<void> {\n this.loading = true;\n this.errors = [];\n\n try {\n const data = await this.getSettings.execute();\n runInAction(() => {\n this.form = this.buildForm();\n this.form.setData(data);\n });\n } catch (err) {\n runInAction(() => {\n this.errors = [err instanceof Error ? err.message : \"Failed to load settings.\"];\n });\n } finally {\n runInAction(() => {\n this.loading = false;\n });\n }\n }\n\n async save(): Promise<boolean> {\n if (!this.form) {\n return false;\n }\n\n const data = await this.form.submit<IAiPowerUpsSettings>();\n if (!data) {\n return false;\n }\n\n runInAction(() => {\n this.saving = true;\n this.errors = [];\n });\n\n try {\n await this.updateSettings.execute(data);\n return true;\n } catch (err) {\n runInAction(() => {\n if (err instanceof SettingsValidationError) {\n this.errors = Object.values(err.data.invalidFields).map(e => e.message);\n } else {\n this.errors = [err instanceof Error ? err.message : \"Failed to save settings.\"];\n }\n });\n return false;\n } finally {\n runInAction(() => {\n this.saving = false;\n });\n }\n }\n\n importData(data: Record<string, unknown>): void {\n if (!this.form) {\n return;\n }\n const current = this.form.getData();\n this.form.setData({ ...current, ...data } as IAiPowerUpsSettings);\n }\n\n private collectGroups(): CollectedGroup[] {\n return this.groups.map(group => {\n const collected: CollectedGroup = {\n group,\n fieldsFn: null,\n layoutFn: null\n };\n\n const builder: AiPowerUpsSettingsGroup.FormBuilder = {\n fields(fn: FieldsFactory) {\n collected.fieldsFn = fn;\n },\n layout(fn: LayoutFactory) {\n collected.layoutFn = fn;\n }\n };\n\n group.buildForm(builder);\n\n return collected;\n });\n }\n\n private buildForm() {\n const collected = this.collectGroups();\n\n const form = this.factory.create<IAiPowerUpsSettings>({\n fields: fields => {\n const result: Record<string, FormModelFactory.FieldBuilder> = {};\n for (const { group, fieldsFn } of collected) {\n if (!fieldsFn) {\n continue;\n }\n result[group.name] = fields\n .object()\n .label(group.label)\n .renderer(\"passthrough\")\n .fields(fieldsFn);\n }\n return result;\n },\n layout: layout => {\n if (collected.length === 0) {\n return [];\n }\n\n const tabsBuilder = layout.tabs(\"settings-tabs\").renderer(\"tabsVertical\");\n\n for (const { group } of collected) {\n tabsBuilder.tab(group.name, tab => {\n tab.label(group.label);\n if (group.description) {\n tab.description(group.description);\n }\n if (group.icon) {\n tab.icon(group.icon);\n }\n tab.layout(l => [l.row(group.name)]);\n });\n }\n\n return [tabsBuilder];\n }\n });\n\n return form;\n }\n}\n\nexport const AiPowerUpsSettingsPresenter = PresenterAbstraction.createImplementation({\n implementation: AiPowerUpsSettingsPresenterImpl,\n dependencies: [\n FormModelFactory,\n [AiPowerUpsSettingsGroup, { multiple: true }],\n GetSettingsUseCase,\n UpdateSettingsUseCase\n ]\n});\n"],"names":["AiPowerUpsSettingsPresenterImpl","factory","groups","getSettings","updateSettings","makeAutoObservable","computed","data","runInAction","err","Error","SettingsValidationError","Object","e","current","group","collected","builder","fn","form","fields","result","fieldsFn","layout","tabsBuilder","tab","l","AiPowerUpsSettingsPresenter","PresenterAbstraction","FormModelFactory","AiPowerUpsSettingsGroup","GetSettingsUseCase","UpdateSettingsUseCase"],"mappings":";;;;;;;AAsBA,MAAMA;IAMF,YACYC,OAAmC,EACnCC,MAA2C,EAC3CC,WAAyC,EACzCC,cAA+C,CACzD;aAJUH,OAAO,GAAPA;aACAC,MAAM,GAANA;aACAC,WAAW,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,EAChB,OAAO,EAAE;gBAGb,MAAMQ,cAAcD,OAAO,IAAI,CAAC,iBAAiB,QAAQ,CAAC;gBAE1D,KAAK,MAAM,EAAER,KAAK,EAAE,IAAIC,UACpBQ,YAAY,GAAG,CAACT,MAAM,IAAI,EAAEU,CAAAA;oBACxBA,IAAI,KAAK,CAACV,MAAM,KAAK;oBACrB,IAAIA,MAAM,WAAW,EACjBU,IAAI,WAAW,CAACV,MAAM,WAAW;oBAErC,IAAIA,MAAM,IAAI,EACVU,IAAI,IAAI,CAACV,MAAM,IAAI;oBAEvBU,IAAI,MAAM,CAACC,CAAAA,IAAK;4BAACA,EAAE,GAAG,CAACX,MAAM,IAAI;yBAAE;gBACvC;gBAGJ,OAAO;oBAACS;iBAAY;YACxB;QACJ;QAEA,OAAOL;IACX;AACJ;AAEO,MAAMQ,0DAA8BC,4BAAAA,oBAAyC,CAAC;IACjF,gBAAgB5B;IAChB,cAAc;QACV6B;QACA;YAACC;YAAyB;gBAAE,UAAU;YAAK;SAAE;QAC7CC;QACAC;KACH;AACL"}
1
+ {"version":3,"file":"admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.js","sources":["../../../../src/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPresenter.ts"],"sourcesContent":["import { makeAutoObservable, computed, runInAction } from \"mobx\";\nimport { FormModelFactory, FormModel } from \"@webiny/app-admin\";\nimport type { ILayoutNodeBuilder } from \"@webiny/app-admin/features/formModel/abstractions.js\";\nimport { GetSettingsUseCase } from \"../../features/settings/getSettings/abstractions.js\";\nimport { UpdateSettingsUseCase } from \"../../features/settings/updateSettings/abstractions.js\";\nimport { AiPowerUpsSettingsPresenter as PresenterAbstraction } from \"./abstractions.js\";\nimport { AiPowerUpsSettingsGroup } from \"./settingsGroup.js\";\nimport { SettingsValidationError } from \"~/admin/domain/errors.js\";\nimport type { IAiPowerUpsSettings } from \"~/admin/features/settings/shared/abstractions.js\";\n\ntype FieldsFactory = (\n fields: FormModelFactory.FieldBuilderRegistry\n) => Record<string, FormModelFactory.FieldBuilder>;\n\ntype LayoutFactory = (layout: FormModelFactory.LayoutBuilder) => ILayoutNodeBuilder[];\n\ninterface CollectedGroup {\n group: AiPowerUpsSettingsGroup.Interface;\n fieldsFn: FieldsFactory | null;\n layoutFn: LayoutFactory | null;\n}\n\nclass AiPowerUpsSettingsPresenterImpl implements PresenterAbstraction.Interface {\n private loading = false;\n private saving = false;\n private form: FormModel.Interface<IAiPowerUpsSettings> | null = null;\n private errors: string[] = [];\n\n constructor(\n private factory: FormModelFactory.Interface,\n private groups: AiPowerUpsSettingsGroup.Interface[],\n private getSettings: GetSettingsUseCase.Interface,\n private updateSettings: UpdateSettingsUseCase.Interface\n ) {\n makeAutoObservable(this, { vm: computed }, { autoBind: true });\n }\n\n get vm(): PresenterAbstraction.ViewModel {\n return {\n loading: this.loading,\n saving: this.saving,\n form: this.form ? this.form.vm : null,\n errors: this.errors\n };\n }\n\n async init(): Promise<void> {\n this.loading = true;\n this.errors = [];\n\n try {\n /*\n * Two loads of different things, started together because neither feeds the other.\n *\n * `getSettings` fetches the saved *values*: the chosen connection, the model on each\n * role, the per-capability overrides. Those go into the form at `setData` below.\n *\n * A group's `init()` loads the catalogue its fields are built *from*.\n * `CapabilitiesSettings` needs the list of registered capabilities to render a row\n * each, plus the model list for the dropdowns; `ModelRoles` and `Connections` need the\n * model list. Four of the seven groups have no init at all, hence the optional call.\n *\n * So the settings blob does not say which fields exist and the catalogue does not say\n * what is configured. Running them one after the other would just cost a round trip.\n *\n * Neither is \"first\": both calls are made in this tick and `Promise.all` only waits, so\n * the array positions pick which result is `data` and which is `initResults`, nothing\n * more. The ordering that matters is that both finish before `buildForm()`, which reads\n * the catalogue, and `setData()`, which needs the values. The `await` does that.\n *\n * `allSettled`, not `all`: one group's failed init should not take the whole screen\n * down. Under `all` a single rejection skipped straight to the catch below and left the\n * page with a heading, a Save button and no tabs at all, hiding every working section.\n *\n * It rescues less than it looks, though. Firing in one tick is also what puts these\n * queries in a single `BatchingGraphQLClient` batch, and that rejects *every* operation\n * in a batch when any one errors (see `executeBatchGroup`), so a group whose query\n * fails server-side takes `getSettings` down with it and we reach the catch anyway.\n * What is left is real but narrower: a group that throws inside its own `init()`, one\n * whose query missed the batch window, and the reporting, which now names the failing\n * section. Covering the batched case means not batching `getSettings` with the group\n * inits, at the cost of a serial round trip on every load of this screen.\n */\n const [data, initResults] = await Promise.all([\n this.getSettings.execute(),\n Promise.allSettled(this.groups.map(group => group.init?.()))\n ]);\n\n /*\n * `flatMap` to filter and map in one pass: a fulfilled group contributes no message.\n * The index is load-bearing, and safe because `allSettled` resolves in input order, so\n * `initResults[index]` is the result for `this.groups[index]`.\n */\n const initErrors = initResults.flatMap((result, index) => {\n if (result.status !== \"rejected\") {\n return [];\n }\n\n const label = this.groups[index].label;\n const reason =\n result.reason instanceof Error ? result.reason.message : String(result.reason);\n\n return [`Could not load the \"${label}\" section: ${reason}`];\n });\n\n runInAction(() => {\n this.errors = initErrors;\n this.form = this.buildForm();\n this.form.setData(data);\n });\n } catch (err) {\n runInAction(() => {\n this.errors = [err instanceof Error ? err.message : \"Failed to load settings.\"];\n });\n } finally {\n runInAction(() => {\n this.loading = false;\n });\n }\n }\n\n async save(): Promise<boolean> {\n if (!this.form) {\n return false;\n }\n\n const data = await this.form.submit<IAiPowerUpsSettings>();\n if (!data) {\n return false;\n }\n\n runInAction(() => {\n this.saving = true;\n this.errors = [];\n });\n\n try {\n await this.updateSettings.execute(data);\n return true;\n } catch (err) {\n runInAction(() => {\n if (err instanceof SettingsValidationError) {\n this.errors = Object.values(err.data.invalidFields).map(e => e.message);\n } else {\n this.errors = [err instanceof Error ? err.message : \"Failed to save settings.\"];\n }\n });\n return false;\n } finally {\n runInAction(() => {\n this.saving = false;\n });\n }\n }\n\n importData(data: Record<string, unknown>): void {\n if (!this.form) {\n return;\n }\n const current = this.form.getData();\n this.form.setData({ ...current, ...data } as IAiPowerUpsSettings);\n }\n\n private collectGroups(): CollectedGroup[] {\n return this.groups.map(group => {\n const collected: CollectedGroup = {\n group,\n fieldsFn: null,\n layoutFn: null\n };\n\n const builder: AiPowerUpsSettingsGroup.FormBuilder = {\n fields(fn: FieldsFactory) {\n collected.fieldsFn = fn;\n },\n layout(fn: LayoutFactory) {\n collected.layoutFn = fn;\n }\n };\n\n group.buildForm(builder);\n\n return collected;\n });\n }\n\n private buildForm() {\n const collected = this.collectGroups();\n\n const form = this.factory.create<IAiPowerUpsSettings>({\n fields: fields => {\n const result: Record<string, FormModelFactory.FieldBuilder> = {};\n for (const { group, fieldsFn } of collected) {\n if (!fieldsFn) {\n continue;\n }\n result[group.name] = fields\n .object()\n .label(group.label)\n .renderer(\"passthrough\")\n .fields(fieldsFn);\n }\n return result;\n },\n layout: layout => {\n if (collected.length === 0) {\n return [];\n }\n\n const tabsBuilder = layout.tabs(\"settings-tabs\").renderer(\"tabsVertical\");\n\n for (const { group } of collected) {\n tabsBuilder.tab(group.name, tab => {\n tab.label(group.label);\n if (group.description) {\n tab.description(group.description);\n }\n if (group.icon) {\n tab.icon(group.icon);\n }\n tab.layout(l => [l.row(group.name)]);\n });\n }\n\n return [tabsBuilder];\n }\n });\n\n return form;\n }\n}\n\nexport const AiPowerUpsSettingsPresenter = PresenterAbstraction.createImplementation({\n implementation: AiPowerUpsSettingsPresenterImpl,\n dependencies: [\n FormModelFactory,\n [AiPowerUpsSettingsGroup, { multiple: true }],\n GetSettingsUseCase,\n UpdateSettingsUseCase\n ]\n});\n"],"names":["AiPowerUpsSettingsPresenterImpl","factory","groups","getSettings","updateSettings","makeAutoObservable","computed","data","initResults","Promise","group","initErrors","result","index","label","reason","Error","String","runInAction","err","SettingsValidationError","Object","e","current","collected","builder","fn","form","fields","fieldsFn","layout","tabsBuilder","tab","l","AiPowerUpsSettingsPresenter","PresenterAbstraction","FormModelFactory","AiPowerUpsSettingsGroup","GetSettingsUseCase","UpdateSettingsUseCase"],"mappings":";;;;;;;AAsBA,MAAMA;IAMF,YACYC,OA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B,cAAc;QACVoC;QACA;YAACC;YAAyB;gBAAE,UAAU;YAAK;SAAE;QAC7CC;QACAC;KACH;AACL"}
@@ -1,14 +1,18 @@
1
1
  import { createFeature } from "@webiny/feature/admin";
2
2
  import { AiPowerUpsSettingsPresenter } from "./abstractions.js";
3
3
  import { AiPowerUpsSettingsPresenter as external_AiPowerUpsSettingsPresenter_js_AiPowerUpsSettingsPresenter } from "./AiPowerUpsSettingsPresenter.js";
4
- import { ProviderSettings } from "../ProvidersSettings.js";
4
+ import { ConnectionsSettings } from "../ConnectionsSettings.js";
5
+ import { ModelRolesSettings } from "../ModelRolesSettings.js";
6
+ import { CapabilitiesSettings } from "../CapabilitiesSettings.js";
5
7
  import { ReaderPersonasSettings } from "../ReaderPersonasSettings.js";
6
8
  import { WriterPersonasSettings } from "../WriterPersonasSettings.js";
7
9
  import { ProjectsSettings } from "../ProjectsSettings.js";
8
10
  const AiPowerUpsSettingsFeature = createFeature({
9
11
  name: "AiPowerUps/Settings/Presenter",
10
12
  register (container) {
11
- container.register(ProviderSettings);
13
+ container.register(ConnectionsSettings);
14
+ container.register(ModelRolesSettings);
15
+ container.register(CapabilitiesSettings);
12
16
  container.register(ReaderPersonasSettings);
13
17
  container.register(WriterPersonasSettings);
14
18
  container.register(ProjectsSettings);