@webiny/ai-powerups 6.4.5 → 6.6.0-alpha.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 (82) hide show
  1. package/admin/Extension.js +2 -1
  2. package/admin/Extension.js.map +1 -1
  3. package/admin/features/generateEntryContent/GenerateEntryContentGateway.d.ts +12 -0
  4. package/admin/features/generateEntryContent/GenerateEntryContentGateway.js +43 -0
  5. package/admin/features/generateEntryContent/GenerateEntryContentGateway.js.map +1 -0
  6. package/admin/features/generateEntryContent/GenerateEntryContentUseCase.d.ts +11 -0
  7. package/admin/features/generateEntryContent/GenerateEntryContentUseCase.js +18 -0
  8. package/admin/features/generateEntryContent/GenerateEntryContentUseCase.js.map +1 -0
  9. package/admin/features/generateEntryContent/abstractions.d.ts +23 -0
  10. package/admin/features/generateEntryContent/abstractions.js +6 -0
  11. package/admin/features/generateEntryContent/abstractions.js.map +1 -0
  12. package/admin/features/generateEntryContent/feature.d.ts +1 -0
  13. package/admin/features/generateEntryContent/feature.js +13 -0
  14. package/admin/features/generateEntryContent/feature.js.map +1 -0
  15. package/admin/features/generateEntryContent/index.d.ts +3 -0
  16. package/admin/features/generateEntryContent/index.js +2 -0
  17. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js +3 -4
  18. package/admin/presentation/AiPowerUpsSettings/AiPowerUpsSettingsPage.js.map +1 -1
  19. package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.d.ts +4 -0
  20. package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.js +27 -0
  21. package/admin/presentation/CmsContentGeneration/CmsGenerateContentButton.js.map +1 -0
  22. package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.d.ts +5 -0
  23. package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.js +106 -0
  24. package/admin/presentation/CmsContentGeneration/CmsGenerateContentDialog.js.map +1 -0
  25. package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.d.ts +37 -0
  26. package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.js +202 -0
  27. package/admin/presentation/CmsContentGeneration/CmsGenerateContentPresenter.js.map +1 -0
  28. package/admin/presentation/CmsContentGeneration/Extension.d.ts +2 -0
  29. package/admin/presentation/CmsContentGeneration/Extension.js +23 -0
  30. package/admin/presentation/CmsContentGeneration/Extension.js.map +1 -0
  31. package/admin/presentation/CmsContentGeneration/abstractions.d.ts +20 -0
  32. package/admin/presentation/CmsContentGeneration/abstractions.js +5 -0
  33. package/admin/presentation/CmsContentGeneration/abstractions.js.map +1 -0
  34. package/admin/presentation/CmsContentGeneration/feature.d.ts +3 -0
  35. package/admin/presentation/CmsContentGeneration/feature.js +17 -0
  36. package/admin/presentation/CmsContentGeneration/feature.js.map +1 -0
  37. package/admin/presentation/ProjectsSettings.js +4 -4
  38. package/admin/presentation/ProjectsSettings.js.map +1 -1
  39. package/admin/presentation/WbContentGeneration/GenerateContentPresenter.js +2 -2
  40. package/admin/presentation/WbContentGeneration/GenerateContentPresenter.js.map +1 -1
  41. package/api/Extension.js +5 -3
  42. package/api/Extension.js.map +1 -1
  43. package/api/features/AiImageEnrichment/AiImageEnrichmentAfterCreateHandler.d.ts +3 -1
  44. package/api/features/AiImageEnrichment/AiImageEnrichmentAfterCreateHandler.js +6 -2
  45. package/api/features/AiImageEnrichment/AiImageEnrichmentAfterCreateHandler.js.map +1 -1
  46. package/api/features/AiImageEnrichment/AiImageEnrichmentTask.d.ts +7 -5
  47. package/api/features/AiImageEnrichment/AiImageEnrichmentTask.js +32 -30
  48. package/api/features/AiImageEnrichment/AiImageEnrichmentTask.js.map +1 -1
  49. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.d.ts +32 -0
  50. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js +74 -0
  51. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js.map +1 -0
  52. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.d.ts +29 -0
  53. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.js +141 -0
  54. package/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentUseCase.js.map +1 -0
  55. package/api/features/CmsGenerateEntryContent/abstractions.d.ts +29 -0
  56. package/api/features/CmsGenerateEntryContent/abstractions.js +5 -0
  57. package/api/features/CmsGenerateEntryContent/abstractions.js.map +1 -0
  58. package/api/features/CmsGenerateEntryContent/buildPrompt.d.ts +2 -0
  59. package/api/features/CmsGenerateEntryContent/buildPrompt.js +61 -0
  60. package/api/features/CmsGenerateEntryContent/buildPrompt.js.map +1 -0
  61. package/api/features/CmsGenerateEntryContent/feature.d.ts +4 -0
  62. package/api/features/CmsGenerateEntryContent/feature.js +13 -0
  63. package/api/features/CmsGenerateEntryContent/feature.js.map +1 -0
  64. package/api/features/CmsGenerateEntryContent/index.d.ts +1 -0
  65. package/api/features/CmsGenerateEntryContent/index.js +1 -0
  66. package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.d.ts +2 -0
  67. package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.js +30 -0
  68. package/api/features/CmsGenerateEntryContent/injectDynamicZoneTypenames.js.map +1 -0
  69. package/api/features/CmsResolveImageTool/CmsResolveImageTool.d.ts +14 -0
  70. package/api/features/CmsResolveImageTool/CmsResolveImageTool.js +27 -0
  71. package/api/features/CmsResolveImageTool/CmsResolveImageTool.js.map +1 -0
  72. package/api/features/CmsResolveImageTool/feature.d.ts +4 -0
  73. package/api/features/CmsResolveImageTool/feature.js +11 -0
  74. package/api/features/CmsResolveImageTool/feature.js.map +1 -0
  75. package/api/features/GetSettings/GetSettingsUseCase.d.ts +1 -1
  76. package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.d.ts +3 -3
  77. package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.js +6 -6
  78. package/api/features/WbGeneratePageContent/WbGeneratePageContentTask.js.map +1 -1
  79. package/api/graphql/BaseGraphQLSchema.d.ts +2 -2
  80. package/api/graphql/BaseGraphQLSchema.js +34 -2
  81. package/api/graphql/BaseGraphQLSchema.js.map +1 -1
  82. package/package.json +23 -22
@@ -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,4 @@
1
+ export declare const CmsGenerateEntryContentFeature: {
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 { CmsGenerateEntryContentUseCaseImplementation } from "./CmsGenerateEntryContentUseCase.js";
3
+ import { CmsGenerateEntryContentTask } from "./CmsGenerateEntryContentTask.js";
4
+ const CmsGenerateEntryContentFeature = createFeature({
5
+ name: "AiPowerUps/CmsGenerateEntryContent",
6
+ register (container) {
7
+ container.register(CmsGenerateEntryContentUseCaseImplementation);
8
+ container.register(CmsGenerateEntryContentTask);
9
+ }
10
+ });
11
+ export { CmsGenerateEntryContentFeature };
12
+
13
+ //# 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\";\n\nexport const CmsGenerateEntryContentFeature = createFeature({\n name: \"AiPowerUps/CmsGenerateEntryContent\",\n register(container) {\n container.register(CmsGenerateEntryContentUseCaseImplementation);\n container.register(CmsGenerateEntryContentTask);\n }\n});\n"],"names":["CmsGenerateEntryContentFeature","createFeature","container","CmsGenerateEntryContentUseCaseImplementation","CmsGenerateEntryContentTask"],"mappings":";;;AAIO,MAAMA,iCAAiCC,cAAc;IACxD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;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"}
@@ -2,7 +2,7 @@ import { GetSettingsUseCase, GetSettingsRepository } from "./abstractions.js";
2
2
  declare class GetSettingsUseCaseImpl implements GetSettingsUseCase.Interface {
3
3
  private repository;
4
4
  constructor(repository: GetSettingsRepository.Interface);
5
- execute(): Promise<import("@webiny/feature/api").Result<import("~/api/types.js").IAiPowerUpsSettings, never>>;
5
+ execute(): Promise<import("@webiny/feature/api/Result.js").Result<import("~/api/types.js").IAiPowerUpsSettings, never>>;
6
6
  }
7
7
  export declare const GetSettingsUseCaseImplementation: typeof GetSettingsUseCaseImpl & {
8
8
  __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetSettingsUseCase>;
@@ -1,5 +1,5 @@
1
1
  import { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
2
- import { WebsocketService } from "@webiny/api-websockets/features/WebsocketService/index.js";
2
+ import { WebsocketsSendToIdentityUseCase } from "@webiny/api-websockets/features/SendToIdentity/abstractions.js";
3
3
  import { WbGeneratePageContentUseCase } from "../../../api/features/WbGeneratePageContent/index.js";
4
4
  import { IdentityContext } from "@webiny/api-core/exports/api/security.js";
5
5
  export declare const WB_GENERATE_PAGE_CONTENT_TASK_ID = "aiPowerUpsGeneratePageContent";
@@ -15,14 +15,14 @@ export interface IWbGeneratePageContentTaskInput {
15
15
  declare class WbGeneratePageContentTaskImpl implements TaskDefinition.Interface<IWbGeneratePageContentTaskInput> {
16
16
  private identityContext;
17
17
  private generatePageContent;
18
- private websocketService;
18
+ private sendToIdentity;
19
19
  id: string;
20
20
  title: string;
21
21
  description: string;
22
22
  maxIterations: number;
23
23
  isPrivate: boolean;
24
24
  databaseLogs: boolean;
25
- constructor(identityContext: IdentityContext.Interface, generatePageContent: WbGeneratePageContentUseCase.Interface, websocketService: WebsocketService.Interface);
25
+ constructor(identityContext: IdentityContext.Interface, generatePageContent: WbGeneratePageContentUseCase.Interface, sendToIdentity: WebsocketsSendToIdentityUseCase.Interface);
26
26
  run({ input, controller }: TaskDefinition.RunParams<IWbGeneratePageContentTaskInput>): Promise<TaskDefinition.Result<IWbGeneratePageContentTaskInput>>;
27
27
  private sendContentToUser;
28
28
  private sendErrorToUser;
@@ -1,14 +1,14 @@
1
1
  import { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
2
- import { WebsocketService } from "@webiny/api-websockets/features/WebsocketService/index.js";
2
+ import { WebsocketsSendToIdentityUseCase } from "@webiny/api-websockets/features/SendToIdentity/abstractions.js";
3
3
  import { compress } from "@webiny/utils/features/compression/legacy/gzip.js";
4
4
  import { WbGeneratePageContentUseCase } from "./index.js";
5
5
  import { IdentityContext } from "@webiny/api-core/exports/api/security.js";
6
6
  const WB_GENERATE_PAGE_CONTENT_TASK_ID = "aiPowerUpsGeneratePageContent";
7
7
  class WbGeneratePageContentTaskImpl {
8
- constructor(identityContext, generatePageContent, websocketService){
8
+ constructor(identityContext, generatePageContent, sendToIdentity){
9
9
  this.identityContext = identityContext;
10
10
  this.generatePageContent = generatePageContent;
11
- this.websocketService = websocketService;
11
+ this.sendToIdentity = sendToIdentity;
12
12
  this.id = WB_GENERATE_PAGE_CONTENT_TASK_ID;
13
13
  this.title = "AI Power-Ups - Generate Page Content";
14
14
  this.description = "Generates page content using AI based on a user prompt.";
@@ -40,7 +40,7 @@ class WbGeneratePageContentTaskImpl {
40
40
  return controller.response.done("Page content generated successfully.");
41
41
  }
42
42
  async sendContentToUser(identityId, payload, telemetry) {
43
- await this.websocketService.send({
43
+ await this.sendToIdentity.execute({
44
44
  id: identityId
45
45
  }, {
46
46
  action: "aiPowerUps.generatePageContent.content",
@@ -52,7 +52,7 @@ class WbGeneratePageContentTaskImpl {
52
52
  });
53
53
  }
54
54
  async sendErrorToUser(identityId, message) {
55
- await this.websocketService.send({
55
+ await this.sendToIdentity.execute({
56
56
  id: identityId
57
57
  }, {
58
58
  action: "aiPowerUps.generatePageContent.error",
@@ -67,7 +67,7 @@ const WbGeneratePageContentTask = TaskDefinition.createImplementation({
67
67
  dependencies: [
68
68
  IdentityContext,
69
69
  WbGeneratePageContentUseCase,
70
- WebsocketService
70
+ WebsocketsSendToIdentityUseCase
71
71
  ]
72
72
  });
73
73
  export { WB_GENERATE_PAGE_CONTENT_TASK_ID, WbGeneratePageContentTask };
@@ -1 +1 @@
1
- {"version":3,"file":"api/features/WbGeneratePageContent/WbGeneratePageContentTask.js","sources":["../../../../src/api/features/WbGeneratePageContent/WbGeneratePageContentTask.ts"],"sourcesContent":["import { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { WebsocketService } from \"@webiny/api-websockets/features/WebsocketService/index.js\";\nimport { compress } from \"@webiny/utils/features/compression/legacy/gzip.js\";\nimport { WbGeneratePageContentUseCase } from \"~/api/features/WbGeneratePageContent/index.js\";\nimport type { GenerationTelemetry } from \"~/api/features/WbGeneratePageContent/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/exports/api/security.js\";\n\nexport const WB_GENERATE_PAGE_CONTENT_TASK_ID = \"aiPowerUpsGeneratePageContent\";\n\nexport interface IWbGeneratePageContentTaskInput {\n prompt: string;\n components: unknown;\n tools: unknown;\n projectId?: string | null;\n excludedFileIds?: string[] | null;\n readerPersonaId?: string | null;\n writerPersonaId?: string | null;\n}\n\nclass WbGeneratePageContentTaskImpl implements TaskDefinition.Interface<IWbGeneratePageContentTaskInput> {\n id = WB_GENERATE_PAGE_CONTENT_TASK_ID;\n title = \"AI Power-Ups - Generate Page Content\";\n description = \"Generates page content using AI based on a user prompt.\";\n maxIterations = 1;\n isPrivate = true;\n databaseLogs = false;\n\n constructor(\n private identityContext: IdentityContext.Interface,\n private generatePageContent: WbGeneratePageContentUseCase.Interface,\n private websocketService: WebsocketService.Interface\n ) {}\n\n async run({\n input,\n controller\n }: TaskDefinition.RunParams<IWbGeneratePageContentTaskInput>): Promise<\n TaskDefinition.Result<IWbGeneratePageContentTaskInput>\n > {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n }\n\n const result = await this.generatePageContent.execute({\n prompt: input.prompt,\n components: input.components,\n tools: input.tools,\n projectId: input.projectId,\n excludedFileIds: input.excludedFileIds,\n readerPersonaId: input.readerPersonaId,\n writerPersonaId: input.writerPersonaId\n });\n\n const identity = this.identityContext.getIdentity();\n\n if (result.isFail()) {\n await this.sendErrorToUser(identity.id, result.error.message);\n\n return controller.response.error({\n message: result.error.message\n });\n }\n\n const compressed = await compress(result.value.output);\n const payload = compressed.toString(\"base64\");\n\n await this.sendContentToUser(identity.id, payload, result.value.telemetry);\n\n return controller.response.done(\"Page content generated successfully.\");\n }\n\n private async sendContentToUser(\n identityId: string,\n payload: string,\n telemetry: GenerationTelemetry\n ) {\n await this.websocketService.send(\n { id: identityId },\n {\n action: \"aiPowerUps.generatePageContent.content\",\n data: {\n compression: \"gzip\",\n value: payload,\n telemetry\n }\n }\n );\n }\n\n private async sendErrorToUser(identityId: string, message: string) {\n await this.websocketService.send(\n { id: identityId },\n {\n action: \"aiPowerUps.generatePageContent.error\",\n data: {\n message\n }\n }\n );\n }\n}\n\nexport const WbGeneratePageContentTask = TaskDefinition.createImplementation({\n implementation: WbGeneratePageContentTaskImpl,\n dependencies: [IdentityContext, WbGeneratePageContentUseCase, WebsocketService]\n});\n"],"names":["WB_GENERATE_PAGE_CONTENT_TASK_ID","WbGeneratePageContentTaskImpl","identityContext","generatePageContent","websocketService","input","controller","result","identity","compressed","compress","payload","identityId","telemetry","message","WbGeneratePageContentTask","TaskDefinition","IdentityContext","WbGeneratePageContentUseCase","WebsocketService"],"mappings":";;;;;AAOO,MAAMA,mCAAmC;AAYhD,MAAMC;IAQF,YACYC,eAA0C,EAC1CC,mBAA2D,EAC3DC,gBAA4C,CACtD;aAHUF,eAAe,GAAfA;aACAC,mBAAmB,GAAnBA;aACAC,gBAAgB,GAAhBA;aAVZ,EAAE,GAAGJ;aACL,KAAK,GAAG;aACR,WAAW,GAAG;aACd,aAAa,GAAG;aAChB,SAAS,GAAG;aACZ,YAAY,GAAG;IAMZ;IAEH,MAAM,IAAI,EACNK,KAAK,EACLC,UAAU,EAC8C,EAE1D;QACE,IAAIA,WAAW,OAAO,CAAC,SAAS,IAC5B,OAAOA,WAAW,QAAQ,CAAC,OAAO;QAGtC,MAAMC,SAAS,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YAClD,QAAQF,MAAM,MAAM;YACpB,YAAYA,MAAM,UAAU;YAC5B,OAAOA,MAAM,KAAK;YAClB,WAAWA,MAAM,SAAS;YAC1B,iBAAiBA,MAAM,eAAe;YACtC,iBAAiBA,MAAM,eAAe;YACtC,iBAAiBA,MAAM,eAAe;QAC1C;QAEA,MAAMG,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QAEjD,IAAID,OAAO,MAAM,IAAI;YACjB,MAAM,IAAI,CAAC,eAAe,CAACC,SAAS,EAAE,EAAED,OAAO,KAAK,CAAC,OAAO;YAE5D,OAAOD,WAAW,QAAQ,CAAC,KAAK,CAAC;gBAC7B,SAASC,OAAO,KAAK,CAAC,OAAO;YACjC;QACJ;QAEA,MAAME,aAAa,MAAMC,SAASH,OAAO,KAAK,CAAC,MAAM;QACrD,MAAMI,UAAUF,WAAW,QAAQ,CAAC;QAEpC,MAAM,IAAI,CAAC,iBAAiB,CAACD,SAAS,EAAE,EAAEG,SAASJ,OAAO,KAAK,CAAC,SAAS;QAEzE,OAAOD,WAAW,QAAQ,CAAC,IAAI,CAAC;IACpC;IAEA,MAAc,kBACVM,UAAkB,EAClBD,OAAe,EACfE,SAA8B,EAChC;QACE,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAC5B;YAAE,IAAID;QAAW,GACjB;YACI,QAAQ;YACR,MAAM;gBACF,aAAa;gBACb,OAAOD;gBACPE;YACJ;QACJ;IAER;IAEA,MAAc,gBAAgBD,UAAkB,EAAEE,OAAe,EAAE;QAC/D,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAC5B;YAAE,IAAIF;QAAW,GACjB;YACI,QAAQ;YACR,MAAM;gBACFE;YACJ;QACJ;IAER;AACJ;AAEO,MAAMC,4BAA4BC,eAAe,oBAAoB,CAAC;IACzE,gBAAgBf;IAChB,cAAc;QAACgB;QAAiBC;QAA8BC;KAAiB;AACnF"}
1
+ {"version":3,"file":"api/features/WbGeneratePageContent/WbGeneratePageContentTask.js","sources":["../../../../src/api/features/WbGeneratePageContent/WbGeneratePageContentTask.ts"],"sourcesContent":["import { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { WebsocketsSendToIdentityUseCase } from \"@webiny/api-websockets/features/SendToIdentity/abstractions.js\";\nimport { compress } from \"@webiny/utils/features/compression/legacy/gzip.js\";\nimport { WbGeneratePageContentUseCase } from \"~/api/features/WbGeneratePageContent/index.js\";\nimport type { GenerationTelemetry } from \"~/api/features/WbGeneratePageContent/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/exports/api/security.js\";\n\nexport const WB_GENERATE_PAGE_CONTENT_TASK_ID = \"aiPowerUpsGeneratePageContent\";\n\nexport interface IWbGeneratePageContentTaskInput {\n prompt: string;\n components: unknown;\n tools: unknown;\n projectId?: string | null;\n excludedFileIds?: string[] | null;\n readerPersonaId?: string | null;\n writerPersonaId?: string | null;\n}\n\nclass WbGeneratePageContentTaskImpl implements TaskDefinition.Interface<IWbGeneratePageContentTaskInput> {\n id = WB_GENERATE_PAGE_CONTENT_TASK_ID;\n title = \"AI Power-Ups - Generate Page Content\";\n description = \"Generates page content using AI based on a user prompt.\";\n maxIterations = 1;\n isPrivate = true;\n databaseLogs = false;\n\n constructor(\n private identityContext: IdentityContext.Interface,\n private generatePageContent: WbGeneratePageContentUseCase.Interface,\n private sendToIdentity: WebsocketsSendToIdentityUseCase.Interface\n ) {}\n\n async run({\n input,\n controller\n }: TaskDefinition.RunParams<IWbGeneratePageContentTaskInput>): Promise<\n TaskDefinition.Result<IWbGeneratePageContentTaskInput>\n > {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n }\n\n const result = await this.generatePageContent.execute({\n prompt: input.prompt,\n components: input.components,\n tools: input.tools,\n projectId: input.projectId,\n excludedFileIds: input.excludedFileIds,\n readerPersonaId: input.readerPersonaId,\n writerPersonaId: input.writerPersonaId\n });\n\n const identity = this.identityContext.getIdentity();\n\n if (result.isFail()) {\n await this.sendErrorToUser(identity.id, result.error.message);\n\n return controller.response.error({\n message: result.error.message\n });\n }\n\n const compressed = await compress(result.value.output);\n const payload = compressed.toString(\"base64\");\n\n await this.sendContentToUser(identity.id, payload, result.value.telemetry);\n\n return controller.response.done(\"Page content generated successfully.\");\n }\n\n private async sendContentToUser(\n identityId: string,\n payload: string,\n telemetry: GenerationTelemetry\n ) {\n await this.sendToIdentity.execute(\n { id: identityId },\n {\n action: \"aiPowerUps.generatePageContent.content\",\n data: {\n compression: \"gzip\",\n value: payload,\n telemetry\n }\n }\n );\n }\n\n private async sendErrorToUser(identityId: string, message: string) {\n await this.sendToIdentity.execute(\n { id: identityId },\n {\n action: \"aiPowerUps.generatePageContent.error\",\n data: {\n message\n }\n }\n );\n }\n}\n\nexport const WbGeneratePageContentTask = TaskDefinition.createImplementation({\n implementation: WbGeneratePageContentTaskImpl,\n dependencies: [IdentityContext, WbGeneratePageContentUseCase, WebsocketsSendToIdentityUseCase]\n});\n"],"names":["WB_GENERATE_PAGE_CONTENT_TASK_ID","WbGeneratePageContentTaskImpl","identityContext","generatePageContent","sendToIdentity","input","controller","result","identity","compressed","compress","payload","identityId","telemetry","message","WbGeneratePageContentTask","TaskDefinition","IdentityContext","WbGeneratePageContentUseCase","WebsocketsSendToIdentityUseCase"],"mappings":";;;;;AAOO,MAAMA,mCAAmC;AAYhD,MAAMC;IAQF,YACYC,eAA0C,EAC1CC,mBAA2D,EAC3DC,cAAyD,CACnE;aAHUF,eAAe,GAAfA;aACAC,mBAAmB,GAAnBA;aACAC,cAAc,GAAdA;aAVZ,EAAE,GAAGJ;aACL,KAAK,GAAG;aACR,WAAW,GAAG;aACd,aAAa,GAAG;aAChB,SAAS,GAAG;aACZ,YAAY,GAAG;IAMZ;IAEH,MAAM,IAAI,EACNK,KAAK,EACLC,UAAU,EAC8C,EAE1D;QACE,IAAIA,WAAW,OAAO,CAAC,SAAS,IAC5B,OAAOA,WAAW,QAAQ,CAAC,OAAO;QAGtC,MAAMC,SAAS,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YAClD,QAAQF,MAAM,MAAM;YACpB,YAAYA,MAAM,UAAU;YAC5B,OAAOA,MAAM,KAAK;YAClB,WAAWA,MAAM,SAAS;YAC1B,iBAAiBA,MAAM,eAAe;YACtC,iBAAiBA,MAAM,eAAe;YACtC,iBAAiBA,MAAM,eAAe;QAC1C;QAEA,MAAMG,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QAEjD,IAAID,OAAO,MAAM,IAAI;YACjB,MAAM,IAAI,CAAC,eAAe,CAACC,SAAS,EAAE,EAAED,OAAO,KAAK,CAAC,OAAO;YAE5D,OAAOD,WAAW,QAAQ,CAAC,KAAK,CAAC;gBAC7B,SAASC,OAAO,KAAK,CAAC,OAAO;YACjC;QACJ;QAEA,MAAME,aAAa,MAAMC,SAASH,OAAO,KAAK,CAAC,MAAM;QACrD,MAAMI,UAAUF,WAAW,QAAQ,CAAC;QAEpC,MAAM,IAAI,CAAC,iBAAiB,CAACD,SAAS,EAAE,EAAEG,SAASJ,OAAO,KAAK,CAAC,SAAS;QAEzE,OAAOD,WAAW,QAAQ,CAAC,IAAI,CAAC;IACpC;IAEA,MAAc,kBACVM,UAAkB,EAClBD,OAAe,EACfE,SAA8B,EAChC;QACE,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B;YAAE,IAAID;QAAW,GACjB;YACI,QAAQ;YACR,MAAM;gBACF,aAAa;gBACb,OAAOD;gBACPE;YACJ;QACJ;IAER;IAEA,MAAc,gBAAgBD,UAAkB,EAAEE,OAAe,EAAE;QAC/D,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B;YAAE,IAAIF;QAAW,GACjB;YACI,QAAQ;YACR,MAAM;gBACFE;YACJ;QACJ;IAER;AACJ;AAEO,MAAMC,4BAA4BC,eAAe,oBAAoB,CAAC;IACzE,gBAAgBf;IAChB,cAAc;QAACgB;QAAiBC;QAA8BC;KAAgC;AAClG"}
@@ -1,8 +1,8 @@
1
- import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
1
+ import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.core.js";
2
2
  declare class BaseGraphQLSchemaImpl implements CoreGraphQLSchemaFactory.Interface {
3
3
  execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): Promise<CoreGraphQLSchemaFactory.SchemaBuilder>;
4
4
  }
5
5
  export declare const BaseGraphQLSchema: typeof BaseGraphQLSchemaImpl & {
6
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public.js").IGraphQLSchemaFactory>;
6
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.core.js").ICoreGraphQLSchemaFactory>;
7
7
  };
8
8
  export {};
@@ -1,11 +1,12 @@
1
- import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
2
- import { ErrorResponse, Response } from "@webiny/handler-graphql/responses.js";
1
+ import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.core.js";
2
+ import { ErrorResponse, Response } from "@webiny/api-graphql/responses.js";
3
3
  import { Ai } from "@webiny/api-core/features/ai/index.js";
4
4
  import { TaskService } from "@webiny/api-core/features/task/TaskService/index.js";
5
5
  import { GetSettingsUseCase } from "../features/GetSettings/index.js";
6
6
  import { UpdateSettingsUseCase } from "../features/UpdateSettings/index.js";
7
7
  import { AiPowerUpsSettingsGraphQLMapper } from "./abstractions.js";
8
8
  import { WB_GENERATE_PAGE_CONTENT_TASK_ID } from "../features/WbGeneratePageContent/WbGeneratePageContentTask.js";
9
+ import { CMS_GENERATE_ENTRY_CONTENT_TASK_ID } from "../features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js";
9
10
  class BaseGraphQLSchemaImpl {
10
11
  async execute(builder) {
11
12
  builder.addTypeDefs(`
@@ -44,6 +45,14 @@ class BaseGraphQLSchemaImpl {
44
45
  readerPersonaId: String
45
46
  writerPersonaId: String
46
47
  ): JSON!
48
+ generateEntryContent(
49
+ prompt: String!
50
+ modelId: String!
51
+ projectId: String
52
+ excludedFileIds: [String!]
53
+ readerPersonaId: String
54
+ writerPersonaId: String
55
+ ): JSON!
47
56
  }
48
57
 
49
58
  extend type Query {
@@ -105,6 +114,29 @@ class BaseGraphQLSchemaImpl {
105
114
  };
106
115
  }
107
116
  });
117
+ builder.addResolver({
118
+ path: "AiPowerUpsMutation.generateEntryContent",
119
+ dependencies: [
120
+ TaskService
121
+ ],
122
+ resolver: (taskService)=>async ({ args })=>{
123
+ const result = await taskService.trigger({
124
+ definition: CMS_GENERATE_ENTRY_CONTENT_TASK_ID,
125
+ input: {
126
+ prompt: args.prompt,
127
+ modelId: args.modelId,
128
+ projectId: args.projectId ?? null,
129
+ excludedFileIds: args.excludedFileIds ?? null,
130
+ readerPersonaId: args.readerPersonaId ?? null,
131
+ writerPersonaId: args.writerPersonaId ?? null
132
+ }
133
+ });
134
+ if (result.isFail()) throw result.error;
135
+ return {
136
+ id: result.value.id
137
+ };
138
+ }
139
+ });
108
140
  builder.addResolver({
109
141
  path: "AiPowerUpsMutation.updateSettings",
110
142
  dependencies: [
@@ -1 +1 @@
1
- {"version":3,"file":"api/graphql/BaseGraphQLSchema.js","sources":["../../../src/api/graphql/BaseGraphQLSchema.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\nimport { Response, ErrorResponse } from \"@webiny/handler-graphql/responses.js\";\nimport { Ai } from \"@webiny/api-core/features/ai/index.js\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/index.js\";\nimport { GetSettingsUseCase } from \"~/api/features/GetSettings/index.js\";\nimport { UpdateSettingsUseCase } from \"~/api/features/UpdateSettings/index.js\";\nimport { AiPowerUpsSettingsGraphQLMapper } from \"./abstractions.js\";\nimport {\n WB_GENERATE_PAGE_CONTENT_TASK_ID,\n type IWbGeneratePageContentTaskInput\n} from \"~/api/features/WbGeneratePageContent/WbGeneratePageContentTask.js\";\n\nclass BaseGraphQLSchemaImpl implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): Promise<CoreGraphQLSchemaFactory.SchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type AiModel {\n providerId: String!\n providerName: String!\n modelId: String!\n modelName: String!\n }\n\n type AiPowerUpsQuery {\n listModels: [AiModel!]!\n getSettings: JSON\n }\n\n type AiPowerUpsError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type AiPowerUpsSettingsResponse {\n data: JSON\n error: AiPowerUpsError\n }\n\n type AiPowerUpsMutation {\n updateSettings(input: JSON!): AiPowerUpsSettingsResponse!\n generatePageContent(\n prompt: String!\n components: JSON!\n tools: JSON!\n projectId: String\n excludedFileIds: [String!]\n readerPersonaId: String\n writerPersonaId: String\n ): JSON!\n }\n\n extend type Query {\n aiPowerUps: AiPowerUpsQuery\n }\n\n extend type Mutation {\n aiPowerUps: AiPowerUpsMutation\n }\n `);\n\n builder.addResolver({\n path: \"Query.aiPowerUps\",\n resolver: () => () => ({})\n });\n\n builder.addResolver({\n path: \"Mutation.aiPowerUps\",\n resolver: () => () => ({})\n });\n\n builder.addResolver({\n path: \"AiPowerUpsQuery.listModels\",\n dependencies: [Ai],\n resolver: (ai: Ai.Interface) => {\n return async () => ai.listModels();\n }\n });\n\n builder.addResolver({\n path: \"AiPowerUpsQuery.getSettings\",\n dependencies: [GetSettingsUseCase, AiPowerUpsSettingsGraphQLMapper],\n resolver: (\n useCase: GetSettingsUseCase.Interface,\n mapper: AiPowerUpsSettingsGraphQLMapper.Interface\n ) => {\n return async () => {\n const result = await useCase.execute();\n if (result.isFail()) {\n throw result.error;\n }\n\n return mapper.toApi(result.value);\n };\n }\n });\n\n builder.addResolver<IWbGeneratePageContentTaskInput>({\n path: \"AiPowerUpsMutation.generatePageContent\",\n dependencies: [TaskService],\n resolver: (taskService: TaskService.Interface) => {\n return async ({ args }) => {\n const result = await taskService.trigger<IWbGeneratePageContentTaskInput>({\n definition: WB_GENERATE_PAGE_CONTENT_TASK_ID,\n input: {\n prompt: args.prompt,\n components: args.components,\n tools: args.tools,\n projectId: args.projectId ?? null,\n excludedFileIds: args.excludedFileIds ?? null,\n readerPersonaId: args.readerPersonaId ?? null,\n writerPersonaId: args.writerPersonaId ?? null\n }\n });\n\n if (result.isFail()) {\n throw result.error;\n }\n\n return { id: result.value.id };\n };\n }\n });\n\n builder.addResolver<{ input: Record<string, unknown> }>({\n path: \"AiPowerUpsMutation.updateSettings\",\n dependencies: [\n GetSettingsUseCase,\n UpdateSettingsUseCase,\n AiPowerUpsSettingsGraphQLMapper\n ],\n resolver: (\n getSettings: GetSettingsUseCase.Interface,\n updateSettings: UpdateSettingsUseCase.Interface,\n mapper: AiPowerUpsSettingsGraphQLMapper.Interface\n ) => {\n return async ({ args }) => {\n const currentResult = await getSettings.execute();\n if (currentResult.isFail()) {\n return new ErrorResponse(currentResult.error);\n }\n\n const assembled = await mapper.fromApi(args.input, currentResult.value);\n const result = await updateSettings.execute(assembled);\n\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n\n return new Response(await mapper.toApi(result.value));\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const BaseGraphQLSchema = CoreGraphQLSchemaFactory.createImplementation({\n implementation: BaseGraphQLSchemaImpl,\n dependencies: []\n});\n"],"names":["BaseGraphQLSchemaImpl","builder","Ai","ai","GetSettingsUseCase","AiPowerUpsSettingsGraphQLMapper","useCase","mapper","result","TaskService","taskService","args","WB_GENERATE_PAGE_CONTENT_TASK_ID","UpdateSettingsUseCase","getSettings","updateSettings","currentResult","ErrorResponse","assembled","Response","BaseGraphQLSchema","CoreGraphQLSchemaFactory"],"mappings":";;;;;;;;AAYA,MAAMA;IACF,MAAM,QACFC,OAA+C,EACA;QAC/CA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6CnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,IAAO,EAAC;QAC5B;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,IAAO,EAAC;QAC5B;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;aAAG;YAClB,UAAU,CAACC,KACA,UAAYA,GAAG,UAAU;QAExC;QAEAF,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACG;gBAAoBC;aAAgC;YACnE,UAAU,CACNC,SACAC,SAEO;oBACH,MAAMC,SAAS,MAAMF,QAAQ,OAAO;oBACpC,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAGtB,OAAOD,OAAO,KAAK,CAACC,OAAO,KAAK;gBACpC;QAER;QAEAP,QAAQ,WAAW,CAAkC;YACjD,MAAM;YACN,cAAc;gBAACQ;aAAY;YAC3B,UAAU,CAACC,cACA,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMH,SAAS,MAAME,YAAY,OAAO,CAAkC;wBACtE,YAAYE;wBACZ,OAAO;4BACH,QAAQD,KAAK,MAAM;4BACnB,YAAYA,KAAK,UAAU;4BAC3B,OAAOA,KAAK,KAAK;4BACjB,WAAWA,KAAK,SAAS,IAAI;4BAC7B,iBAAiBA,KAAK,eAAe,IAAI;4BACzC,iBAAiBA,KAAK,eAAe,IAAI;4BACzC,iBAAiBA,KAAK,eAAe,IAAI;wBAC7C;oBACJ;oBAEA,IAAIH,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAGtB,OAAO;wBAAE,IAAIA,OAAO,KAAK,CAAC,EAAE;oBAAC;gBACjC;QAER;QAEAP,QAAQ,WAAW,CAAqC;YACpD,MAAM;YACN,cAAc;gBACVG;gBACAS;gBACAR;aACH;YACD,UAAU,CACNS,aACAC,gBACAR,SAEO,OAAO,EAAEI,IAAI,EAAE;oBAClB,MAAMK,gBAAgB,MAAMF,YAAY,OAAO;oBAC/C,IAAIE,cAAc,MAAM,IACpB,OAAO,IAAIC,cAAcD,cAAc,KAAK;oBAGhD,MAAME,YAAY,MAAMX,OAAO,OAAO,CAACI,KAAK,KAAK,EAAEK,cAAc,KAAK;oBACtE,MAAMR,SAAS,MAAMO,eAAe,OAAO,CAACG;oBAE5C,IAAIV,OAAO,MAAM,IACb,OAAO,IAAIS,cAAcT,OAAO,KAAK;oBAGzC,OAAO,IAAIW,SAAS,MAAMZ,OAAO,KAAK,CAACC,OAAO,KAAK;gBACvD;QAER;QAEA,OAAOP;IACX;AACJ;AAEO,MAAMmB,oBAAoBC,yBAAyB,oBAAoB,CAAC;IAC3E,gBAAgBrB;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"api/graphql/BaseGraphQLSchema.js","sources":["../../../src/api/graphql/BaseGraphQLSchema.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.core.js\";\nimport { Response, ErrorResponse } from \"@webiny/api-graphql/responses.js\";\nimport { Ai } from \"@webiny/api-core/features/ai/index.js\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/index.js\";\nimport { GetSettingsUseCase } from \"~/api/features/GetSettings/index.js\";\nimport { UpdateSettingsUseCase } from \"~/api/features/UpdateSettings/index.js\";\nimport { AiPowerUpsSettingsGraphQLMapper } from \"./abstractions.js\";\nimport {\n WB_GENERATE_PAGE_CONTENT_TASK_ID,\n type IWbGeneratePageContentTaskInput\n} from \"~/api/features/WbGeneratePageContent/WbGeneratePageContentTask.js\";\nimport {\n CMS_GENERATE_ENTRY_CONTENT_TASK_ID,\n type ICmsGenerateEntryContentTaskInput\n} from \"~/api/features/CmsGenerateEntryContent/CmsGenerateEntryContentTask.js\";\n\nclass BaseGraphQLSchemaImpl implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): Promise<CoreGraphQLSchemaFactory.SchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type AiModel {\n providerId: String!\n providerName: String!\n modelId: String!\n modelName: String!\n }\n\n type AiPowerUpsQuery {\n listModels: [AiModel!]!\n getSettings: JSON\n }\n\n type AiPowerUpsError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type AiPowerUpsSettingsResponse {\n data: JSON\n error: AiPowerUpsError\n }\n\n type AiPowerUpsMutation {\n updateSettings(input: JSON!): AiPowerUpsSettingsResponse!\n generatePageContent(\n prompt: String!\n components: JSON!\n tools: JSON!\n projectId: String\n excludedFileIds: [String!]\n readerPersonaId: String\n writerPersonaId: String\n ): JSON!\n generateEntryContent(\n prompt: String!\n modelId: String!\n projectId: String\n excludedFileIds: [String!]\n readerPersonaId: String\n writerPersonaId: String\n ): JSON!\n }\n\n extend type Query {\n aiPowerUps: AiPowerUpsQuery\n }\n\n extend type Mutation {\n aiPowerUps: AiPowerUpsMutation\n }\n `);\n\n builder.addResolver({\n path: \"Query.aiPowerUps\",\n resolver: () => () => ({})\n });\n\n builder.addResolver({\n path: \"Mutation.aiPowerUps\",\n resolver: () => () => ({})\n });\n\n builder.addResolver({\n path: \"AiPowerUpsQuery.listModels\",\n dependencies: [Ai],\n resolver: (ai: Ai.Interface) => {\n return async () => ai.listModels();\n }\n });\n\n builder.addResolver({\n path: \"AiPowerUpsQuery.getSettings\",\n dependencies: [GetSettingsUseCase, AiPowerUpsSettingsGraphQLMapper],\n resolver: (\n useCase: GetSettingsUseCase.Interface,\n mapper: AiPowerUpsSettingsGraphQLMapper.Interface\n ) => {\n return async () => {\n const result = await useCase.execute();\n if (result.isFail()) {\n throw result.error;\n }\n\n return mapper.toApi(result.value);\n };\n }\n });\n\n builder.addResolver<IWbGeneratePageContentTaskInput>({\n path: \"AiPowerUpsMutation.generatePageContent\",\n dependencies: [TaskService],\n resolver: (taskService: TaskService.Interface) => {\n return async ({ args }) => {\n const result = await taskService.trigger<IWbGeneratePageContentTaskInput>({\n definition: WB_GENERATE_PAGE_CONTENT_TASK_ID,\n input: {\n prompt: args.prompt,\n components: args.components,\n tools: args.tools,\n projectId: args.projectId ?? null,\n excludedFileIds: args.excludedFileIds ?? null,\n readerPersonaId: args.readerPersonaId ?? null,\n writerPersonaId: args.writerPersonaId ?? null\n }\n });\n\n if (result.isFail()) {\n throw result.error;\n }\n\n return { id: result.value.id };\n };\n }\n });\n\n builder.addResolver<ICmsGenerateEntryContentTaskInput>({\n path: \"AiPowerUpsMutation.generateEntryContent\",\n dependencies: [TaskService],\n resolver: (taskService: TaskService.Interface) => {\n return async ({ args }) => {\n const result = await taskService.trigger<ICmsGenerateEntryContentTaskInput>({\n definition: CMS_GENERATE_ENTRY_CONTENT_TASK_ID,\n input: {\n prompt: args.prompt,\n modelId: args.modelId,\n projectId: args.projectId ?? null,\n excludedFileIds: args.excludedFileIds ?? null,\n readerPersonaId: args.readerPersonaId ?? null,\n writerPersonaId: args.writerPersonaId ?? null\n }\n });\n\n if (result.isFail()) {\n throw result.error;\n }\n\n return { id: result.value.id };\n };\n }\n });\n\n builder.addResolver<{ input: Record<string, unknown> }>({\n path: \"AiPowerUpsMutation.updateSettings\",\n dependencies: [\n GetSettingsUseCase,\n UpdateSettingsUseCase,\n AiPowerUpsSettingsGraphQLMapper\n ],\n resolver: (\n getSettings: GetSettingsUseCase.Interface,\n updateSettings: UpdateSettingsUseCase.Interface,\n mapper: AiPowerUpsSettingsGraphQLMapper.Interface\n ) => {\n return async ({ args }) => {\n const currentResult = await getSettings.execute();\n if (currentResult.isFail()) {\n return new ErrorResponse(currentResult.error);\n }\n\n const assembled = await mapper.fromApi(args.input, currentResult.value);\n const result = await updateSettings.execute(assembled);\n\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n\n return new Response(await mapper.toApi(result.value));\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const BaseGraphQLSchema = CoreGraphQLSchemaFactory.createImplementation({\n implementation: BaseGraphQLSchemaImpl,\n dependencies: []\n});\n"],"names":["BaseGraphQLSchemaImpl","builder","Ai","ai","GetSettingsUseCase","AiPowerUpsSettingsGraphQLMapper","useCase","mapper","result","TaskService","taskService","args","WB_GENERATE_PAGE_CONTENT_TASK_ID","CMS_GENERATE_ENTRY_CONTENT_TASK_ID","UpdateSettingsUseCase","getSettings","updateSettings","currentResult","ErrorResponse","assembled","Response","BaseGraphQLSchema","CoreGraphQLSchemaFactory"],"mappings":";;;;;;;;;AAgBA,MAAMA;IACF,MAAM,QACFC,OAA+C,EACA;QAC/CA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqDnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,IAAO,EAAC;QAC5B;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,IAAO,EAAC;QAC5B;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;aAAG;YAClB,UAAU,CAACC,KACA,UAAYA,GAAG,UAAU;QAExC;QAEAF,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACG;gBAAoBC;aAAgC;YACnE,UAAU,CACNC,SACAC,SAEO;oBACH,MAAMC,SAAS,MAAMF,QAAQ,OAAO;oBACpC,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAGtB,OAAOD,OAAO,KAAK,CAACC,OAAO,KAAK;gBACpC;QAER;QAEAP,QAAQ,WAAW,CAAkC;YACjD,MAAM;YACN,cAAc;gBAACQ;aAAY;YAC3B,UAAU,CAACC,cACA,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMH,SAAS,MAAME,YAAY,OAAO,CAAkC;wBACtE,YAAYE;wBACZ,OAAO;4BACH,QAAQD,KAAK,MAAM;4BACnB,YAAYA,KAAK,UAAU;4BAC3B,OAAOA,KAAK,KAAK;4BACjB,WAAWA,KAAK,SAAS,IAAI;4BAC7B,iBAAiBA,KAAK,eAAe,IAAI;4BACzC,iBAAiBA,KAAK,eAAe,IAAI;4BACzC,iBAAiBA,KAAK,eAAe,IAAI;wBAC7C;oBACJ;oBAEA,IAAIH,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAGtB,OAAO;wBAAE,IAAIA,OAAO,KAAK,CAAC,EAAE;oBAAC;gBACjC;QAER;QAEAP,QAAQ,WAAW,CAAoC;YACnD,MAAM;YACN,cAAc;gBAACQ;aAAY;YAC3B,UAAU,CAACC,cACA,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMH,SAAS,MAAME,YAAY,OAAO,CAAoC;wBACxE,YAAYG;wBACZ,OAAO;4BACH,QAAQF,KAAK,MAAM;4BACnB,SAASA,KAAK,OAAO;4BACrB,WAAWA,KAAK,SAAS,IAAI;4BAC7B,iBAAiBA,KAAK,eAAe,IAAI;4BACzC,iBAAiBA,KAAK,eAAe,IAAI;4BACzC,iBAAiBA,KAAK,eAAe,IAAI;wBAC7C;oBACJ;oBAEA,IAAIH,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAGtB,OAAO;wBAAE,IAAIA,OAAO,KAAK,CAAC,EAAE;oBAAC;gBACjC;QAER;QAEAP,QAAQ,WAAW,CAAqC;YACpD,MAAM;YACN,cAAc;gBACVG;gBACAU;gBACAT;aACH;YACD,UAAU,CACNU,aACAC,gBACAT,SAEO,OAAO,EAAEI,IAAI,EAAE;oBAClB,MAAMM,gBAAgB,MAAMF,YAAY,OAAO;oBAC/C,IAAIE,cAAc,MAAM,IACpB,OAAO,IAAIC,cAAcD,cAAc,KAAK;oBAGhD,MAAME,YAAY,MAAMZ,OAAO,OAAO,CAACI,KAAK,KAAK,EAAEM,cAAc,KAAK;oBACtE,MAAMT,SAAS,MAAMQ,eAAe,OAAO,CAACG;oBAE5C,IAAIX,OAAO,MAAM,IACb,OAAO,IAAIU,cAAcV,OAAO,KAAK;oBAGzC,OAAO,IAAIY,SAAS,MAAMb,OAAO,KAAK,CAACC,OAAO,KAAK;gBACvD;QAER;QAEA,OAAOP;IACX;AACJ;AAEO,MAAMoB,oBAAoBC,yBAAyB,oBAAoB,CAAC;IAC3E,gBAAgBtB;IAChB,cAAc,EAAE;AACpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/ai-powerups",
3
- "version": "6.4.5",
3
+ "version": "6.6.0-alpha.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -18,21 +18,23 @@
18
18
  "author": "Webiny Ltd.",
19
19
  "license": "Webiny Enterprise",
20
20
  "dependencies": {
21
- "@webiny/admin-ui": "6.4.5",
22
- "@webiny/api-core": "6.4.5",
23
- "@webiny/api-file-manager": "6.4.5",
24
- "@webiny/api-websockets": "6.4.5",
25
- "@webiny/app": "6.4.5",
26
- "@webiny/app-admin": "6.4.5",
27
- "@webiny/app-website-builder": "6.4.5",
28
- "@webiny/app-websockets": "6.4.5",
29
- "@webiny/background-tasks": "6.4.5",
30
- "@webiny/feature": "6.4.5",
31
- "@webiny/icons": "6.4.5",
32
- "@webiny/project": "6.4.5",
33
- "@webiny/project-aws": "6.4.5",
34
- "@webiny/utils": "6.4.5",
35
- "ai": "7.0.18",
21
+ "@webiny/admin-ui": "6.6.0-alpha.0",
22
+ "@webiny/api-core": "6.6.0-alpha.0",
23
+ "@webiny/api-file-manager": "6.6.0-alpha.0",
24
+ "@webiny/api-headless-cms": "6.6.0-alpha.0",
25
+ "@webiny/api-websockets": "6.6.0-alpha.0",
26
+ "@webiny/app": "6.6.0-alpha.0",
27
+ "@webiny/app-admin": "6.6.0-alpha.0",
28
+ "@webiny/app-headless-cms": "6.6.0-alpha.0",
29
+ "@webiny/app-website-builder": "6.6.0-alpha.0",
30
+ "@webiny/app-websockets": "6.6.0-alpha.0",
31
+ "@webiny/background-tasks": "6.6.0-alpha.0",
32
+ "@webiny/feature": "6.6.0-alpha.0",
33
+ "@webiny/icons": "6.6.0-alpha.0",
34
+ "@webiny/project": "6.6.0-alpha.0",
35
+ "@webiny/project-aws": "6.6.0-alpha.0",
36
+ "@webiny/utils": "6.6.0-alpha.0",
37
+ "ai": "7.0.40",
36
38
  "front-matter": "4.0.2",
37
39
  "lodash": "4.18.1",
38
40
  "mobx": "6.16.1",
@@ -42,13 +44,12 @@
42
44
  "zod": "4.4.3"
43
45
  },
44
46
  "devDependencies": {
45
- "@webiny/build-tools": "6.4.5",
46
- "@webiny/handler-aws": "6.4.5",
47
- "@webiny/handler-graphql": "6.4.5",
48
- "@webiny/project-utils": "6.4.5",
49
- "@webiny/wcp": "6.4.5",
47
+ "@webiny/api-graphql": "6.6.0-alpha.0",
48
+ "@webiny/build-tools": "6.6.0-alpha.0",
49
+ "@webiny/project-utils": "6.6.0-alpha.0",
50
+ "@webiny/wcp": "6.6.0-alpha.0",
50
51
  "rimraf": "6.1.3",
51
- "typescript": "6.0.3",
52
+ "typescript": "7.0.2",
52
53
  "vitest": "4.1.10"
53
54
  },
54
55
  "publishConfig": {