@wix/ditto-codegen-public 1.0.136 → 1.0.138

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 (58) hide show
  1. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/ProductChat.tsx +26 -20
  2. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.tsx +12 -11
  3. package/dist/out.js +213 -172
  4. package/package.json +2 -2
  5. package/dist/examples-apps/ai-chatbot/src/backend/api/chat/api.ts +0 -62
  6. package/dist/examples-apps/ai-chatbot/src/backend/api/settings/api.ts +0 -39
  7. package/dist/examples-apps/ai-chatbot/src/backend/database.ts +0 -86
  8. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.json +0 -6
  9. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.json +0 -6
  10. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.tsx +0 -105
  11. package/dist/examples-apps/ai-chatbot/src/dashboard/pages/wix_logo.svg +0 -18
  12. package/dist/examples-apps/ai-chatbot/src/dashboard/utils.ts +0 -27
  13. package/dist/examples-apps/custom-products-catalog/.nvmrc +0 -1
  14. package/dist/examples-apps/custom-products-catalog/README.md +0 -21
  15. package/dist/examples-apps/custom-products-catalog/package-lock.json +0 -8694
  16. package/dist/examples-apps/custom-products-catalog/package.json +0 -33
  17. package/dist/examples-apps/custom-products-catalog/src/dashboard/components/create-product.tsx +0 -54
  18. package/dist/examples-apps/custom-products-catalog/src/dashboard/hooks/stores.ts +0 -60
  19. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.json +0 -5
  20. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.tsx +0 -297
  21. package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/wix_logo.svg +0 -18
  22. package/dist/examples-apps/custom-products-catalog/src/dashboard/withProviders.tsx +0 -16
  23. package/dist/examples-apps/custom-products-catalog/src/env.d.ts +0 -4
  24. package/dist/examples-apps/custom-products-catalog/tsconfig.json +0 -8
  25. package/dist/examples-apps/custom-products-catalog/wix.config.json +0 -5
  26. package/dist/examples-apps/site-popup/.nvmrc +0 -1
  27. package/dist/examples-apps/site-popup/README.md +0 -21
  28. package/dist/examples-apps/site-popup/package.json +0 -51
  29. package/dist/examples-apps/site-popup/src/components/activation-configuration.tsx +0 -49
  30. package/dist/examples-apps/site-popup/src/components/close-button.css +0 -33
  31. package/dist/examples-apps/site-popup/src/components/close-button.tsx +0 -31
  32. package/dist/examples-apps/site-popup/src/components/date-range-picker.tsx +0 -49
  33. package/dist/examples-apps/site-popup/src/components/image-picker.tsx +0 -33
  34. package/dist/examples-apps/site-popup/src/components/popup/index.css +0 -133
  35. package/dist/examples-apps/site-popup/src/components/popup/index.tsx +0 -71
  36. package/dist/examples-apps/site-popup/src/components/site-popup-settings.tsx +0 -120
  37. package/dist/examples-apps/site-popup/src/dashboard/hooks/wix-embeds.ts +0 -33
  38. package/dist/examples-apps/site-popup/src/dashboard/pages/page.tsx +0 -78
  39. package/dist/examples-apps/site-popup/src/dashboard/withProviders.tsx +0 -22
  40. package/dist/examples-apps/site-popup/src/extensions.ts +0 -20
  41. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.html +0 -13
  42. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.css +0 -21
  43. package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.tsx +0 -57
  44. package/dist/examples-apps/site-popup/src/types.ts +0 -14
  45. package/dist/examples-apps/site-popup/tsconfig.json +0 -9
  46. package/dist/examples-apps/site-popup/wix.config.json +0 -5
  47. package/dist/examples-apps/spis-examples/src/dashboard/pages/page.tsx +0 -59
  48. package/dist/examples-apps/spis-examples/src/dashboard/pages/wix_logo.svg +0 -18
  49. package/dist/examples-apps/top-blog-posts/.nvmrc +0 -1
  50. package/dist/examples-apps/top-blog-posts/README.md +0 -21
  51. package/dist/examples-apps/top-blog-posts/package-lock.json +0 -6406
  52. package/dist/examples-apps/top-blog-posts/package.json +0 -31
  53. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/blog-utils.ts +0 -44
  54. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/page.tsx +0 -129
  55. package/dist/examples-apps/top-blog-posts/src/dashboard/pages/wix_logo.svg +0 -18
  56. package/dist/examples-apps/top-blog-posts/src/env.d.ts +0 -4
  57. package/dist/examples-apps/top-blog-posts/tsconfig.json +0 -8
  58. package/dist/examples-apps/top-blog-posts/wix.config.json +0 -5
package/dist/out.js CHANGED
@@ -115335,11 +115335,8 @@ var require_planner = __commonJS({
115335
115335
  return `
115336
115336
  <WIXCLI_PLANNER_SYSTEM_PROMPT>
115337
115337
  You are a planner that generates a structured JSON response with specific top-level fields.
115338
-
115339
- ${(0, iterationScenarios_1.getCommonScenariosDocumentation)({ hasEmbeddedScriptExtensions })}
115340
-
115341
- ${(0, iterationScenarios_1.getQuickDecisionGuide)({ hasEmbeddedScriptExtensions, hasBackendApiExtensions })}
115342
-
115338
+ ${isIteration ? (0, iterationScenarios_1.getCommonScenariosDocumentation)({ hasEmbeddedScriptExtensions }) : ""}
115339
+ ${isIteration ? (0, iterationScenarios_1.getQuickDecisionGuide)({ hasEmbeddedScriptExtensions, hasBackendApiExtensions }) : ""}
115343
115340
  <your_responsibilities>
115344
115341
  You are responsible for handling OPERATIONS ONLY:
115345
115342
  - Collection schema changes (add/remove fields, update permissions)
@@ -115356,7 +115353,7 @@ If the user request is ONLY about data structures (collections, permissions, par
115356
115353
  If the user request is about CODE FIXES (errors, bugs, logic), return EMPTY arrays - the CodeAgent will handle it.
115357
115354
  </your_responsibilities>
115358
115355
 
115359
- ${isIteration && (0, iteration_1.iterationModePrompt)({ hasEmbeddedScriptExtensions, hasBackendApiExtensions })}
115356
+ ${isIteration ? (0, iteration_1.iterationModePrompt)({ hasEmbeddedScriptExtensions, hasBackendApiExtensions }) : ""}
115360
115357
  ${(0, data_1.cmsPlannerPrompt)()}
115361
115358
  ${hasBackendApiExtensions ? (0, apiSpec_1.apiSpecPrompt)() : ""}
115362
115359
  ${hasEmbeddedScriptExtensions ? (0, embeddedScriptDynamicParameters_1.embeddedScriptDynamicParametersPrompt)() : ""}
@@ -115902,10 +115899,92 @@ var require_forceDataPermissionsToAnyone = __commonJS({
115902
115899
  }
115903
115900
  });
115904
115901
 
115902
+ // ../../node_modules/dedent/dist/dedent.js
115903
+ var require_dedent = __commonJS({
115904
+ "../../node_modules/dedent/dist/dedent.js"(exports2, module2) {
115905
+ "use strict";
115906
+ Object.defineProperty(exports2, "__esModule", {
115907
+ value: true
115908
+ });
115909
+ exports2.default = void 0;
115910
+ var dedent = createDedent({});
115911
+ var _default = exports2.default = dedent;
115912
+ function createDedent(options) {
115913
+ dedent2.withOptions = (newOptions) => createDedent({
115914
+ ...options,
115915
+ ...newOptions
115916
+ });
115917
+ return dedent2;
115918
+ function dedent2(strings, ...values) {
115919
+ const raw = typeof strings === "string" ? [strings] : strings.raw;
115920
+ const {
115921
+ alignValues = false,
115922
+ escapeSpecialCharacters = Array.isArray(strings),
115923
+ trimWhitespace = true
115924
+ } = options;
115925
+ let result = "";
115926
+ for (let i = 0; i < raw.length; i++) {
115927
+ let next = raw[i];
115928
+ if (escapeSpecialCharacters) {
115929
+ next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{");
115930
+ }
115931
+ result += next;
115932
+ if (i < values.length) {
115933
+ const value = alignValues ? alignValue(values[i], result) : values[i];
115934
+ result += value;
115935
+ }
115936
+ }
115937
+ const lines = result.split("\n");
115938
+ let mindent = null;
115939
+ for (const l of lines) {
115940
+ const m = l.match(/^(\s+)\S+/);
115941
+ if (m) {
115942
+ const indent = m[1].length;
115943
+ if (!mindent) {
115944
+ mindent = indent;
115945
+ } else {
115946
+ mindent = Math.min(mindent, indent);
115947
+ }
115948
+ }
115949
+ }
115950
+ if (mindent !== null) {
115951
+ const m = mindent;
115952
+ result = lines.map((l) => l[0] === " " || l[0] === " " ? l.slice(m) : l).join("\n");
115953
+ }
115954
+ if (trimWhitespace) {
115955
+ result = result.trim();
115956
+ }
115957
+ if (escapeSpecialCharacters) {
115958
+ result = result.replace(/\\n/g, "\n");
115959
+ }
115960
+ return result;
115961
+ }
115962
+ }
115963
+ function alignValue(value, precedingText) {
115964
+ if (typeof value !== "string" || !value.includes("\n")) {
115965
+ return value;
115966
+ }
115967
+ const currentLine = precedingText.slice(precedingText.lastIndexOf("\n") + 1);
115968
+ const indentMatch = currentLine.match(/^(\s+)/);
115969
+ if (indentMatch) {
115970
+ const indent = indentMatch[1];
115971
+ return value.replace(/\n/g, `
115972
+ ${indent}`);
115973
+ }
115974
+ return value;
115975
+ }
115976
+ module2.exports = exports2.default;
115977
+ module2.exports.default = exports2.default;
115978
+ }
115979
+ });
115980
+
115905
115981
  // dist/agents/planner/PlannerAgent.js
115906
115982
  var require_PlannerAgent = __commonJS({
115907
115983
  "dist/agents/planner/PlannerAgent.js"(exports2) {
115908
115984
  "use strict";
115985
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
115986
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
115987
+ };
115909
115988
  Object.defineProperty(exports2, "__esModule", { value: true });
115910
115989
  exports2.PlannerAgent = void 0;
115911
115990
  var types_1 = require_types_impl();
@@ -115916,19 +115995,21 @@ var require_PlannerAgent = __commonJS({
115916
115995
  var ditto_codegen_types_2 = require_dist();
115917
115996
  var PlannerAgentSchema_1 = require_PlannerAgentSchema();
115918
115997
  var forceDataPermissionsToAnyone_1 = require_forceDataPermissionsToAnyone();
115998
+ var dedent_1 = __importDefault2(require_dedent());
115919
115999
  var PlannerAgent = class {
115920
- constructor(apiKey) {
116000
+ constructor(apiKey, useIteration = false) {
115921
116001
  this.apiKey = apiKey;
116002
+ this.useIteration = useIteration;
115922
116003
  this.name = "PlannerAgent";
115923
116004
  }
115924
- buildSystemPrompt(hasEmbeddedScriptExtensions, hasBackendApiExtensions, isIteration) {
115925
- return (0, planner_1.plannerPrompt)({
116005
+ buildSystemPrompt(hasEmbeddedScriptExtensions, hasBackendApiExtensions) {
116006
+ return (0, dedent_1.default)`${(0, planner_1.plannerPrompt)({
115926
116007
  hasEmbeddedScriptExtensions,
115927
116008
  hasBackendApiExtensions,
115928
- isIteration
115929
- });
116009
+ isIteration: this.useIteration
116010
+ })}`;
115930
116011
  }
115931
- async generatePlan({ systemPrompt, blueprint, error, previousResources, schema, isIteration }) {
116012
+ async generatePlan({ systemPrompt, blueprint, error, previousResources, schema }) {
115932
116013
  const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-3-5-haiku-latest");
115933
116014
  const userContent = `
115934
116015
  ${JSON.stringify(blueprint, null, 2)}
@@ -115963,14 +116044,14 @@ ${error}` : ""}
115963
116044
  }
115964
116045
  });
115965
116046
  const plan = result.object;
115966
- if (!isIteration) {
116047
+ if (!this.useIteration) {
115967
116048
  console.log("\u{1F513} Force data permissions to ANYONE");
115968
116049
  (0, forceDataPermissionsToAnyone_1.forceDataPermissionsToAnyone)(plan);
115969
116050
  }
115970
116051
  return plan;
115971
116052
  }
115972
116053
  async generate(blueprint, options) {
115973
- const { isIteration = false, previousResources } = options || {};
116054
+ const { previousResources } = options || {};
115974
116055
  const extensions = blueprint?.extensions || [];
115975
116056
  if (extensions.length === 0) {
115976
116057
  return {
@@ -115979,7 +116060,7 @@ ${error}` : ""}
115979
116060
  }
115980
116061
  const hasEmbeddedScriptExtensions = extensions.some((ext) => ext.type === types_1.ExtensionType.EMBEDDED_SCRIPT);
115981
116062
  const hasBackendApiExtensions = extensions.some((ext) => ext.type === types_1.ExtensionType.BACKEND_API);
115982
- const systemPrompt = this.buildSystemPrompt(hasEmbeddedScriptExtensions, hasBackendApiExtensions, isIteration);
116063
+ const systemPrompt = this.buildSystemPrompt(hasEmbeddedScriptExtensions, hasBackendApiExtensions);
115983
116064
  const schema = (0, PlannerAgentSchema_1.createPlannerOutputSchema)({
115984
116065
  hasEmbeddedScriptExtensions,
115985
116066
  hasBackendApiExtensions
@@ -115992,8 +116073,7 @@ ${error}` : ""}
115992
116073
  blueprint,
115993
116074
  error: lastError,
115994
116075
  previousResources,
115995
- schema,
115996
- isIteration
116076
+ schema
115997
116077
  });
115998
116078
  return result;
115999
116079
  } catch (error) {
@@ -117795,50 +117875,20 @@ var require_load_examples = __commonJS({
117795
117875
  return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
117796
117876
  };
117797
117877
  Object.defineProperty(exports2, "__esModule", { value: true });
117798
- exports2.loadExamples = exports2.types = void 0;
117878
+ exports2.loadExamples = void 0;
117799
117879
  var fs_1 = __importDefault2(require("fs"));
117800
117880
  var path_1 = __importDefault2(require("path"));
117801
- var types;
117802
- (function(types2) {
117803
- types2[types2["APIExtension"] = 0] = "APIExtension";
117804
- types2[types2["DashboardPage"] = 1] = "DashboardPage";
117805
- types2[types2["EmbeddedScript"] = 2] = "EmbeddedScript";
117806
- types2[types2["ServicePluginExtension"] = 3] = "ServicePluginExtension";
117807
- types2[types2["CustomElementPlugin"] = 4] = "CustomElementPlugin";
117808
- types2[types2["CustomElementWidget"] = 5] = "CustomElementWidget";
117809
- types2[types2["BackendEvent"] = 6] = "BackendEvent";
117810
- })(types || (exports2.types = types = {}));
117881
+ var types_1 = require_types_impl();
117811
117882
  var appsExamples = {
117812
117883
  AIChatbot: {
117813
117884
  path: "ai-chatbot",
117814
117885
  description: "The app creates a chatbot connected to an AI that appears on a site owner's dashboard. The AI answers questions about products in the site's store",
117815
117886
  files: {
117816
- [types.APIExtension]: [
117817
- "ai-chatbot/src/backend/api/chat/api.ts",
117818
- "ai-chatbot/src/backend/api/settings/api.ts",
117819
- "ai-chatbot/src/backend/database.ts",
117820
- "ai-chatbot/src/types.ts"
117821
- ],
117822
- [types.DashboardPage]: [
117887
+ [types_1.ExtensionType.DASHBOARD_PAGE]: [
117823
117888
  "ai-chatbot/src/dashboard/pages/product/page.tsx",
117824
117889
  "ai-chatbot/src/dashboard/pages/product/ProductChat.module.css",
117825
117890
  "ai-chatbot/src/dashboard/pages/product/ProductChat.tsx",
117826
- "ai-chatbot/src/dashboard/pages/settings/page.tsx",
117827
- "ai-chatbot/src/dashboard/utils.ts",
117828
- "ai-chatbot/src/dashboard/withProviders.tsx",
117829
- "ai-chatbot/src/types.ts"
117830
- ]
117831
- }
117832
- },
117833
- CustomProductsCatalog: {
117834
- path: "custom-products-catalog",
117835
- description: "A dashboard app that provides a custom interface for managing products with advanced filtering, bulk operations, and CRUD functionality for store products",
117836
- files: {
117837
- [types.DashboardPage]: [
117838
- "custom-products-catalog/src/dashboard/pages/page.tsx",
117839
- "custom-products-catalog/src/dashboard/components/create-product.tsx",
117840
- "custom-products-catalog/src/dashboard/hooks/stores.ts",
117841
- "custom-products-catalog/src/dashboard/withProviders.tsx"
117891
+ "ai-chatbot/src/dashboard/withProviders.tsx"
117842
117892
  ]
117843
117893
  }
117844
117894
  },
@@ -117846,7 +117896,7 @@ var require_load_examples = __commonJS({
117846
117896
  path: "inventory-countdown",
117847
117897
  description: "A site plugin that displays real-time inventory countdown for products, showing stock levels and urgency messaging to encourage purchases",
117848
117898
  files: {
117849
- [types.CustomElementPlugin]: [
117899
+ [types_1.ExtensionType.SITE_COMPONENT]: [
117850
117900
  "inventory-countdown/src/site/plugins/custom-elements/stock-counter/plugin.tsx",
117851
117901
  "inventory-countdown/src/site/plugins/custom-elements/stock-counter/plugin.module.css",
117852
117902
  "inventory-countdown/src/site/plugins/custom-elements/stock-counter/panel.tsx",
@@ -117858,13 +117908,13 @@ var require_load_examples = __commonJS({
117858
117908
  path: "mixpanel-analytics",
117859
117909
  description: "An analytics integration app that embeds Mixpanel tracking scripts into websites and provides a dashboard interface for configuring analytics tokens",
117860
117910
  files: {
117861
- [types.DashboardPage]: [
117911
+ [types_1.ExtensionType.DASHBOARD_PAGE]: [
117862
117912
  "mixpanel-analytics/src/dashboard/pages/page.tsx",
117863
117913
  "mixpanel-analytics/src/dashboard/components/ProjectToken.tsx",
117864
117914
  "mixpanel-analytics/src/dashboard/hooks/wix-embeds.ts",
117865
117915
  "mixpanel-analytics/src/dashboard/withProviders.tsx"
117866
117916
  ],
117867
- [types.EmbeddedScript]: [
117917
+ [types_1.ExtensionType.EMBEDDED_SCRIPT]: [
117868
117918
  "mixpanel-analytics/src/site/embedded-scripts/mixpanel-analytics/embedded.html"
117869
117919
  ]
117870
117920
  }
@@ -117873,36 +117923,8 @@ var require_load_examples = __commonJS({
117873
117923
  path: "my-locations-app",
117874
117924
  description: "The Locations app allows site owners to easily manage their business locations and hours of operation. The app will contain a dashboard page with a list of the site owner's business locations, and a button to edit the hours for each location",
117875
117925
  files: {
117876
- [types.DashboardPage]: ["my-locations-app/src/dashboard/pages/page.tsx"]
117877
- }
117878
- },
117879
- SitePopup: {
117880
- path: "site-popup",
117881
- description: "A marketing app that creates configurable popup overlays for websites with customizable content, images, and activation settings to engage visitors",
117882
- files: {
117883
- [types.DashboardPage]: [
117884
- "site-popup/src/dashboard/pages/page.tsx",
117885
- "site-popup/src/dashboard/hooks/wix-embeds.ts",
117886
- "site-popup/src/dashboard/withProviders.tsx",
117887
- "site-popup/src/components/site-popup-settings.tsx",
117888
- "site-popup/src/components/activation-configuration.tsx",
117889
- "site-popup/src/components/close-button.tsx",
117890
- "site-popup/src/components/close-button.css",
117891
- "site-popup/src/components/date-range-picker.tsx",
117892
- "site-popup/src/components/image-picker.tsx",
117893
- "site-popup/src/components/popup/index.tsx",
117894
- "site-popup/src/components/popup/index.css",
117895
- "site-popup/src/types.ts"
117896
- ],
117897
- [types.EmbeddedScript]: [
117898
- "site-popup/src/site/embedded-scripts/site-popup/embedded.html",
117899
- "site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.tsx",
117900
- "site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.css",
117901
- "site-popup/src/types.ts",
117902
- "site-popup/src/components/popup/index.tsx",
117903
- "site-popup/src/components/popup/index.css",
117904
- "site-popup/src/components/close-button.tsx",
117905
- "site-popup/src/components/close-button.css"
117926
+ [types_1.ExtensionType.DASHBOARD_PAGE]: [
117927
+ "my-locations-app/src/dashboard/pages/page.tsx"
117906
117928
  ]
117907
117929
  }
117908
117930
  },
@@ -117910,7 +117932,7 @@ var require_load_examples = __commonJS({
117910
117932
  path: "custom-element",
117911
117933
  description: "A Custom Element that displays a countdown timer",
117912
117934
  files: {
117913
- [types.CustomElementWidget]: [
117935
+ [types_1.ExtensionType.SITE_WIDGET]: [
117914
117936
  "custom-element/src/widgets/custom-elements/countdown-timer/widget.tsx"
117915
117937
  ]
117916
117938
  }
@@ -117919,8 +117941,7 @@ var require_load_examples = __commonJS({
117919
117941
  path: "spis-examples",
117920
117942
  description: "A comprehensive collection of Service Plugin Interface (SPI) examples demonstrating ecommerce integrations including additional fees, discount triggers, shipping rates, validations, and gift card providers",
117921
117943
  files: {
117922
- [types.DashboardPage]: ["spis-examples/src/dashboard/pages/page.tsx"],
117923
- [types.ServicePluginExtension]: [
117944
+ [types_1.ExtensionType.SERVICE_PLUGIN]: [
117924
117945
  "spis-examples/src/backend/service-plugins/ecom-additional-fees/additional-fees/plugin.ts",
117925
117946
  "spis-examples/src/backend/service-plugins/ecom-discount-triggers/discount-triggers/plugin.ts",
117926
117947
  "spis-examples/src/backend/service-plugins/ecom-shipping-rates/shipping-rates/plugin.ts",
@@ -117929,35 +117950,27 @@ var require_load_examples = __commonJS({
117929
117950
  ]
117930
117951
  }
117931
117952
  },
117932
- TopBlogPosts: {
117933
- path: "top-blog-posts",
117934
- description: "A dashboard analytics app that displays statistics about the most viewed and most liked blog posts on a website with navigation to blog management",
117935
- files: {
117936
- [types.DashboardPage]: [
117937
- "top-blog-posts/src/dashboard/pages/page.tsx",
117938
- "top-blog-posts/src/dashboard/pages/blog-utils.ts"
117939
- ]
117940
- }
117941
- },
117942
117953
  SurveyManager: {
117943
117954
  path: "survey-manager",
117944
117955
  description: "A dashboard app that allows administrators to create and manage rating (1-5) survey questions and view aggregated results",
117945
117956
  files: {
117946
- [types.DashboardPage]: ["survey-manager/src/dashboard/pages/page.tsx"]
117957
+ [types_1.ExtensionType.DASHBOARD_PAGE]: [
117958
+ "survey-manager/src/dashboard/pages/page.tsx"
117959
+ ]
117947
117960
  }
117948
117961
  },
117949
117962
  EventCountdown: {
117950
117963
  path: "event-countdown",
117951
117964
  description: "A dashboard app that allows administrators to create and manage countdown timers for events",
117952
117965
  files: {
117953
- [types.DashboardPage]: [
117966
+ [types_1.ExtensionType.DASHBOARD_PAGE]: [
117954
117967
  "event-countdown/src/dashboard/pages/countdown-timer-settings/page.tsx",
117955
117968
  "event-countdown/src/components/countdown-timer-settings.tsx",
117956
117969
  "event-countdown/src/components/countdown-preview.tsx",
117957
117970
  "event-countdown/src/types.ts",
117958
117971
  "event-countdown/src/dashboard/withProviders.tsx"
117959
117972
  ],
117960
- [types.EmbeddedScript]: [
117973
+ [types_1.ExtensionType.EMBEDDED_SCRIPT]: [
117961
117974
  "event-countdown/src/site/embedded-scripts/countdown-timer/embedded.html"
117962
117975
  ]
117963
117976
  }
@@ -117966,7 +117979,7 @@ var require_load_examples = __commonJS({
117966
117979
  path: "product-created-logger",
117967
117980
  description: "A webhook that logs product changes",
117968
117981
  files: {
117969
- [types.BackendEvent]: [
117982
+ [types_1.ExtensionType.BACKEND_EVENT]: [
117970
117983
  "product-created-logger/src/backend/events/product-created-logger/event.ts"
117971
117984
  ]
117972
117985
  }
@@ -117975,7 +117988,7 @@ var require_load_examples = __commonJS({
117975
117988
  path: "contact-created-logger",
117976
117989
  description: "A webhook that logs contact created",
117977
117990
  files: {
117978
- [types.BackendEvent]: [
117991
+ [types_1.ExtensionType.BACKEND_EVENT]: [
117979
117992
  "contact-created-logger/src/backend/events/contact-created-logger/event.ts"
117980
117993
  ]
117981
117994
  }
@@ -117984,68 +117997,54 @@ var require_load_examples = __commonJS({
117984
117997
  path: "coupon-popup",
117985
117998
  description: "A marketing app that displays a configurable coupon popup in the shopping cart, with a dashboard interface for managing popup settings and an embedded script to show the popup on the site",
117986
117999
  files: {
117987
- [types.DashboardPage]: [
118000
+ [types_1.ExtensionType.DASHBOARD_PAGE]: [
117988
118001
  "coupon-popup/src/dashboard/pages/cart-popup-manager/page.tsx",
117989
118002
  "coupon-popup/src/dashboard/withProviders.tsx",
117990
118003
  "coupon-popup/src/components/cart-popup-settings.tsx"
117991
118004
  ],
117992
- [types.EmbeddedScript]: [
118005
+ [types_1.ExtensionType.EMBEDDED_SCRIPT]: [
117993
118006
  "coupon-popup/src/site/embedded-scripts/cart-coupon-popup/embedded.html"
117994
118007
  ]
117995
118008
  }
117996
118009
  }
117997
118010
  };
117998
118011
  var examples = {
117999
- [types.APIExtension]: [appsExamples.AIChatbot],
118000
- [types.DashboardPage]: [
118012
+ [types_1.ExtensionType.DASHBOARD_PAGE]: [
118001
118013
  appsExamples.SurveyManager,
118002
118014
  appsExamples.EventCountdown,
118003
- appsExamples.SitePopup,
118004
118015
  appsExamples.CouponPopup,
118005
118016
  appsExamples.AIChatbot,
118006
- appsExamples.CustomProductsCatalog,
118007
118017
  appsExamples.MixPanelAnalystic,
118008
- appsExamples.MyLocationApp,
118009
- appsExamples.SitePopup,
118010
- appsExamples.SPISExample,
118011
- appsExamples.TopBlogPosts
118018
+ appsExamples.MyLocationApp
118012
118019
  ],
118013
- [types.EmbeddedScript]: [
118020
+ [types_1.ExtensionType.EMBEDDED_SCRIPT]: [
118014
118021
  appsExamples.MixPanelAnalystic,
118015
- appsExamples.SitePopup,
118016
118022
  appsExamples.CouponPopup,
118017
118023
  appsExamples.EventCountdown
118018
118024
  ],
118019
- [types.ServicePluginExtension]: [appsExamples.SPISExample],
118020
- [types.CustomElementPlugin]: [appsExamples.InventoryCountdown],
118021
- [types.CustomElementWidget]: [appsExamples.CustomElementWidget],
118022
- [types.BackendEvent]: [
118025
+ [types_1.ExtensionType.SERVICE_PLUGIN]: [appsExamples.SPISExample],
118026
+ [types_1.ExtensionType.SITE_COMPONENT]: [appsExamples.InventoryCountdown],
118027
+ [types_1.ExtensionType.SITE_WIDGET]: [appsExamples.CustomElementWidget],
118028
+ [types_1.ExtensionType.BACKEND_EVENT]: [
118023
118029
  appsExamples.ProductCreatedLogger,
118024
118030
  appsExamples.ContactCreatedLogger
118025
118031
  ]
118026
118032
  };
118027
- var loadExamples = (pluginTypes) => {
118033
+ var loadExamples = (extensionType) => {
118028
118034
  const examplesAppsBasePath = path_1.default.join(__dirname, "examples-apps");
118029
- let examplesPrompts = `Examples applications for ${pluginTypes.map((t) => types[t]).join(", ")}:
118030
-
118031
- `;
118032
- const allExamples = [];
118033
- pluginTypes.forEach((pluginType) => {
118034
- const typeExamples = examples[pluginType] || [];
118035
- allExamples.push(...typeExamples);
118036
- });
118037
- const uniqueExamples = allExamples.filter((example, index, array) => array.findIndex((e) => e.path === example.path) === index);
118038
- uniqueExamples.forEach((example, index) => {
118035
+ const pluginExamples = examples[extensionType] || [];
118036
+ if (!pluginExamples.length) {
118037
+ return "";
118038
+ }
118039
+ let examplesPrompts = "Examples applications:\n\n";
118040
+ pluginExamples.forEach((example, index) => {
118039
118041
  examplesPrompts += `## Example ${index + 1}: ${example.path}
118040
118042
  `;
118041
118043
  examplesPrompts += `Description: ${example.description}
118042
118044
 
118043
118045
  `;
118044
118046
  const relevantFiles = /* @__PURE__ */ new Set();
118045
- pluginTypes.forEach((pluginType) => {
118046
- const filesForType = example.files[pluginType] || [];
118047
- filesForType.forEach((file) => relevantFiles.add(file));
118048
- });
118047
+ example.files[extensionType]?.forEach((file) => relevantFiles.add(file));
118049
118048
  Array.from(relevantFiles).forEach((filePath) => {
118050
118049
  try {
118051
118050
  const fileContent = fs_1.default.readFileSync(path_1.default.join(examplesAppsBasePath, filePath), "utf-8");
@@ -118155,8 +118154,6 @@ var require_BackendEventAgent = __commonJS({
118155
118154
 
118156
118155
  - **[CRITICAL] If the prompt describes an action that should be triggered by a platform event, you must include a BACKEND_EVENT extension to handle the platform event. These scenarios require server-side event listeners to respond to platform events, not client-side conditional logic.**
118157
118156
 
118158
- - **[CRITICAL] If a backend extension needs to listen to two or more webhooks, you MUST return it as separate BACKEND_EVENT extensions - one extension per webhook. Each BACKEND_EVENT extension should handle a single webhook event.**
118159
-
118160
118157
  - **Examples of Platform Events**:
118161
118158
  - eCommerce: checkout created/completed, order created/updated
118162
118159
  - Contacts: contact created/updated
@@ -118685,6 +118682,9 @@ To modify a file, you can either use the 'edit' operation to replace a specific
118685
118682
  var require_DashboardPageAgent2 = __commonJS({
118686
118683
  "dist/agents/DashboardPageAgent.js"(exports2) {
118687
118684
  "use strict";
118685
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
118686
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
118687
+ };
118688
118688
  Object.defineProperty(exports2, "__esModule", { value: true });
118689
118689
  exports2.DashboardPageAgent = void 0;
118690
118690
  var dashboardPagePrompt_1 = require_dashboardPagePrompt();
@@ -118697,6 +118697,8 @@ var require_DashboardPageAgent2 = __commonJS({
118697
118697
  var userPrompt_1 = require_userPrompt();
118698
118698
  var ditto_codegen_types_12 = require_dist();
118699
118699
  var file_operations_1 = require_file_operations();
118700
+ var types_1 = require_types_impl();
118701
+ var dedent_1 = __importDefault2(require_dedent());
118700
118702
  var DashboardPageAgent = class {
118701
118703
  constructor(apiKey, useIteration = false) {
118702
118704
  this.apiKey = apiKey;
@@ -118707,18 +118709,25 @@ var require_DashboardPageAgent2 = __commonJS({
118707
118709
  return (0, codegen_common_logic_1.getDashboardPageAgentDocumentation)();
118708
118710
  }
118709
118711
  async buildSystemPrompt(opts) {
118710
- return (0, dashboardPagePrompt_1.dashboardPagePrompt)({ ...opts, useIteration: this.useIteration });
118712
+ const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.DASHBOARD_PAGE);
118713
+ const systemPrompt = await (0, dashboardPagePrompt_1.dashboardPagePrompt)({
118714
+ ...opts,
118715
+ useIteration: this.useIteration
118716
+ });
118717
+ return (0, dedent_1.default)`${systemPrompt}${examples}`;
118711
118718
  }
118712
118719
  async generate(params) {
118713
118720
  const { blueprint, plan } = params;
118714
- const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.DashboardPage]);
118715
118721
  const useData = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
118716
118722
  const useApiSpec = Boolean(plan?.apiSpec);
118717
118723
  const useDynamicParameters = (0, prompt_selectors_1.shouldUseDynamicParametersPrompt)(params);
118718
118724
  const apiNames = (0, api_1.extractApiNames)(params.extension);
118719
- const systemPrompt = `${await this.buildSystemPrompt({ useData, useApiSpec, useDynamicParameters, apiNames })}
118720
- ${examples}
118721
- `;
118725
+ const systemPrompt = await this.buildSystemPrompt({
118726
+ useData,
118727
+ useApiSpec,
118728
+ useDynamicParameters,
118729
+ apiNames
118730
+ });
118722
118731
  const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
118723
118732
  const primaryAction = `Customize the Wix CLI dashboard page scaffolding for the app ${appName}`;
118724
118733
  const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
@@ -118761,7 +118770,7 @@ var require_siteComponentPrompt = __commonJS({
118761
118770
  var apiDocLoader_1 = require_apiDocLoader();
118762
118771
  var contextExplanation_1 = require_contextExplanation();
118763
118772
  var corePrinciples_1 = require_corePrinciples();
118764
- var siteComponentPrompt = async (apiNames, useData, useIteration) => {
118773
+ var siteComponentPrompt = (apiNames, useData, useIteration) => {
118765
118774
  const apiDocs = (0, apiDocLoader_1.loadApiDocumentation)(apiNames, useData, useIteration);
118766
118775
  const contextExplanation = (0, contextExplanation_1.getContextExplanation)({
118767
118776
  supportsCollections: useData,
@@ -118819,6 +118828,9 @@ var require_siteComponentPrompt = __commonJS({
118819
118828
  var require_SiteComponentAgent2 = __commonJS({
118820
118829
  "dist/agents/SiteComponentAgent.js"(exports2) {
118821
118830
  "use strict";
118831
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
118832
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
118833
+ };
118822
118834
  Object.defineProperty(exports2, "__esModule", { value: true });
118823
118835
  exports2.SiteComponentAgent = void 0;
118824
118836
  var anthropic_1 = require_dist6();
@@ -118829,6 +118841,7 @@ var require_SiteComponentAgent2 = __commonJS({
118829
118841
  var userPrompt_1 = require_userPrompt();
118830
118842
  var ditto_codegen_types_12 = require_dist();
118831
118843
  var file_operations_1 = require_file_operations();
118844
+ var dedent_1 = __importDefault2(require_dedent());
118832
118845
  var SiteComponentAgent = class {
118833
118846
  constructor(apiKey, useIteration = false) {
118834
118847
  this.apiKey = apiKey;
@@ -118838,14 +118851,14 @@ var require_SiteComponentAgent2 = __commonJS({
118838
118851
  getAgentDocumentation() {
118839
118852
  return (0, codegen_common_logic_1.getSiteComponentAgentDocumentation)();
118840
118853
  }
118841
- async buildSystemPrompt(apiNames, useData) {
118842
- return (0, siteComponentPrompt_1.siteComponentPrompt)(apiNames, useData, this.useIteration);
118854
+ buildSystemPrompt(apiNames, useData) {
118855
+ return (0, dedent_1.default)`${(0, siteComponentPrompt_1.siteComponentPrompt)(apiNames, useData, this.useIteration)}`;
118843
118856
  }
118844
118857
  async generate(params) {
118845
118858
  const { blueprint, plan } = params;
118846
118859
  const allApiNames = (0, api_1.extractApiNames)(params.extension);
118847
118860
  const useData = Boolean(plan?.collections?.length);
118848
- const systemPrompt = `${await this.buildSystemPrompt(allApiNames, useData)}`;
118861
+ const systemPrompt = this.buildSystemPrompt(allApiNames, useData);
118849
118862
  const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
118850
118863
  const primaryAction = `Customize the Wix CLI site component scaffolding for the app ${appName}`;
118851
118864
  const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
@@ -118888,7 +118901,7 @@ var require_customElementPrompt = __commonJS({
118888
118901
  var apiDocLoader_1 = require_apiDocLoader();
118889
118902
  var contextExplanation_1 = require_contextExplanation();
118890
118903
  var corePrinciples_1 = require_corePrinciples();
118891
- var customElementPrompt = async (apiNames, useData, useIteration) => {
118904
+ var customElementPrompt = (apiNames, useData, useIteration) => {
118892
118905
  const contextExplanation = (0, contextExplanation_1.getContextExplanation)({
118893
118906
  supportsCollections: useData,
118894
118907
  supportsEmbeddedScriptParameters: false
@@ -118946,6 +118959,9 @@ var require_customElementPrompt = __commonJS({
118946
118959
  var require_CustomElementAgent2 = __commonJS({
118947
118960
  "dist/agents/CustomElementAgent.js"(exports2) {
118948
118961
  "use strict";
118962
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
118963
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
118964
+ };
118949
118965
  Object.defineProperty(exports2, "__esModule", { value: true });
118950
118966
  exports2.CustomElementAgent = void 0;
118951
118967
  var anthropic_1 = require_dist6();
@@ -118957,6 +118973,8 @@ var require_CustomElementAgent2 = __commonJS({
118957
118973
  var codegen_common_logic_1 = require_dist11();
118958
118974
  var userPrompt_1 = require_userPrompt();
118959
118975
  var file_operations_1 = require_file_operations();
118976
+ var types_1 = require_types_impl();
118977
+ var dedent_1 = __importDefault2(require_dedent());
118960
118978
  var CustomElementAgent = class {
118961
118979
  constructor(apiKey, useIteration = false) {
118962
118980
  this.apiKey = apiKey;
@@ -118966,17 +118984,16 @@ var require_CustomElementAgent2 = __commonJS({
118966
118984
  getAgentDocumentation() {
118967
118985
  return (0, codegen_common_logic_1.getCustomElementAgentDocumentation)();
118968
118986
  }
118969
- async buildSystemPrompt(apiNames, useData) {
118970
- return (0, customElementPrompt_1.customElementPrompt)(apiNames, useData, this.useIteration);
118987
+ buildSystemPrompt(apiNames, useData) {
118988
+ const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.SITE_WIDGET);
118989
+ const systemPrompt = (0, customElementPrompt_1.customElementPrompt)(apiNames, useData, this.useIteration);
118990
+ return (0, dedent_1.default)`${systemPrompt}${examples}`;
118971
118991
  }
118972
118992
  async generate(params) {
118973
118993
  const { blueprint, plan } = params;
118974
- const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.CustomElementWidget]);
118975
118994
  const allApiNames = (0, api_1.extractApiNames)(params.extension);
118976
118995
  const useData = Boolean(plan?.collections?.length);
118977
- const systemPrompt = `${await this.buildSystemPrompt(allApiNames, useData)}
118978
- ${examples}
118979
- `;
118996
+ const systemPrompt = this.buildSystemPrompt(allApiNames, useData);
118980
118997
  const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
118981
118998
  const primaryAction = `Customize the Wix CLI custom element / site widget scaffolding for the app ${appName}`;
118982
118999
  const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
@@ -119227,6 +119244,9 @@ ${apiDocs}
119227
119244
  var require_SPIAgent2 = __commonJS({
119228
119245
  "dist/agents/SPIAgent.js"(exports2) {
119229
119246
  "use strict";
119247
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
119248
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
119249
+ };
119230
119250
  Object.defineProperty(exports2, "__esModule", { value: true });
119231
119251
  exports2.SPIAgent = void 0;
119232
119252
  var servicePluginPrompt_1 = require_servicePluginPrompt();
@@ -119239,6 +119259,8 @@ var require_SPIAgent2 = __commonJS({
119239
119259
  var codegen_common_logic_1 = require_dist11();
119240
119260
  var userPrompt_1 = require_userPrompt();
119241
119261
  var file_operations_1 = require_file_operations();
119262
+ var types_1 = require_types_impl();
119263
+ var dedent_1 = __importDefault2(require_dedent());
119242
119264
  var SPIAgent = class {
119243
119265
  constructor(apiKey, useIteration = false) {
119244
119266
  this.apiKey = apiKey;
@@ -119249,17 +119271,16 @@ var require_SPIAgent2 = __commonJS({
119249
119271
  return (0, codegen_common_logic_1.getSPIAgentDocumentation)();
119250
119272
  }
119251
119273
  buildSystemPrompt(spiNames = [], apiNames = [], useData) {
119252
- return (0, servicePluginPrompt_1.getServicePluginPrompt)(spiNames, apiNames, useData, this.useIteration);
119274
+ const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.SERVICE_PLUGIN);
119275
+ const systemPrompt = (0, servicePluginPrompt_1.getServicePluginPrompt)(spiNames, apiNames, useData, this.useIteration);
119276
+ return (0, dedent_1.default)`${systemPrompt}${examples}`;
119253
119277
  }
119254
119278
  async generate(params) {
119255
119279
  const { extension, blueprint } = params;
119256
- const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.ServicePluginExtension]);
119257
119280
  const allSpiNames = extension.relatedSpis?.map((spi) => spi.name).filter((name) => !!name) || [];
119258
119281
  const apiNames = (0, api_1.extractApiNames)(params.extension);
119259
119282
  const useData = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
119260
- const systemPrompt = `${this.buildSystemPrompt(allSpiNames, apiNames, useData)}
119261
- ${examples}
119262
- `;
119283
+ const systemPrompt = this.buildSystemPrompt(allSpiNames, apiNames, useData);
119263
119284
  const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
119264
119285
  const primaryAction = `Customize the Wix CLI service plugin scaffolding for the app ${appName}`;
119265
119286
  const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
@@ -119361,6 +119382,9 @@ ${apiDocs}
119361
119382
  var require_BackendEventAgent2 = __commonJS({
119362
119383
  "dist/agents/BackendEventAgent.js"(exports2) {
119363
119384
  "use strict";
119385
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
119386
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
119387
+ };
119364
119388
  Object.defineProperty(exports2, "__esModule", { value: true });
119365
119389
  exports2.BackendEventAgent = void 0;
119366
119390
  var anthropic_1 = require_dist6();
@@ -119373,6 +119397,8 @@ var require_BackendEventAgent2 = __commonJS({
119373
119397
  var codegen_common_logic_1 = require_dist11();
119374
119398
  var userPrompt_1 = require_userPrompt();
119375
119399
  var file_operations_1 = require_file_operations();
119400
+ var types_1 = require_types_impl();
119401
+ var dedent_1 = __importDefault2(require_dedent());
119376
119402
  var BackendEventAgent = class {
119377
119403
  constructor(apiKey, useIteration = false) {
119378
119404
  this.apiKey = apiKey;
@@ -119383,16 +119409,15 @@ var require_BackendEventAgent2 = __commonJS({
119383
119409
  return (0, codegen_common_logic_1.getBackendEventAgentDocumentation)();
119384
119410
  }
119385
119411
  buildSystemPrompt(apiNames = [], useData) {
119386
- return (0, backendEventPrompt_1.backendEventPrompt)(apiNames, useData, this.useIteration);
119412
+ const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.BACKEND_EVENT);
119413
+ const systemPrompt = (0, backendEventPrompt_1.backendEventPrompt)(apiNames, useData, this.useIteration);
119414
+ return (0, dedent_1.default)`${systemPrompt}${examples}`;
119387
119415
  }
119388
119416
  async generate(params) {
119389
119417
  const { blueprint } = params;
119390
- const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.BackendEvent]);
119391
119418
  const allApiNames = (0, api_1.extractApiNames)(params.extension);
119392
119419
  const useData = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
119393
- const systemPrompt = `${this.buildSystemPrompt(allApiNames, useData)}
119394
- ${examples}
119395
- `;
119420
+ const systemPrompt = this.buildSystemPrompt(allApiNames, useData);
119396
119421
  const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
119397
119422
  const primaryAction = `Customize backend event scaffolding for the app ${appName}`;
119398
119423
  const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
@@ -119523,6 +119548,9 @@ ${(0, corePrinciples_1.getCorePrinciples)()}
119523
119548
  var require_BackendApiAgent2 = __commonJS({
119524
119549
  "dist/agents/BackendApiAgent.js"(exports2) {
119525
119550
  "use strict";
119551
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
119552
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
119553
+ };
119526
119554
  Object.defineProperty(exports2, "__esModule", { value: true });
119527
119555
  exports2.BackendApiAgent = void 0;
119528
119556
  var anthropic_1 = require_dist6();
@@ -119532,6 +119560,7 @@ var require_BackendApiAgent2 = __commonJS({
119532
119560
  var codegen_common_logic_1 = require_dist11();
119533
119561
  var userPrompt_1 = require_userPrompt();
119534
119562
  var file_operations_1 = require_file_operations();
119563
+ var dedent_1 = __importDefault2(require_dedent());
119535
119564
  var BackendApiAgent = class {
119536
119565
  constructor(apiKey) {
119537
119566
  this.apiKey = apiKey;
@@ -119541,7 +119570,7 @@ var require_BackendApiAgent2 = __commonJS({
119541
119570
  return (0, codegen_common_logic_1.getBackendApiAgentDocumentation)();
119542
119571
  }
119543
119572
  buildSystemPrompt() {
119544
- return (0, backendApi_1.backendApiPrompt)();
119573
+ return (0, dedent_1.default)`${(0, backendApi_1.backendApiPrompt)()}`;
119545
119574
  }
119546
119575
  async generate(params) {
119547
119576
  const { blueprint } = params;
@@ -119833,6 +119862,8 @@ var require_EmbeddedScriptAgent2 = __commonJS({
119833
119862
  var codegen_common_logic_1 = require_dist11();
119834
119863
  var userPrompt_1 = require_userPrompt();
119835
119864
  var file_operations_1 = require_file_operations();
119865
+ var types_1 = require_types_impl();
119866
+ var dedent_1 = __importDefault2(require_dedent());
119836
119867
  var EmbeddedScriptPlacement;
119837
119868
  (function(EmbeddedScriptPlacement2) {
119838
119869
  EmbeddedScriptPlacement2["HEAD"] = "HEAD";
@@ -119861,17 +119892,16 @@ var require_EmbeddedScriptAgent2 = __commonJS({
119861
119892
  return (0, codegen_common_logic_1.getEmbeddedScriptAgentDocumentation)();
119862
119893
  }
119863
119894
  buildSystemPrompt(hasDynamicParameters, apiNames, useData) {
119864
- return (0, embededScript_1.embeddedScriptPrompt)(hasDynamicParameters, apiNames, useData, this.useIteration);
119895
+ const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.EMBEDDED_SCRIPT);
119896
+ const systemPrompt = (0, embededScript_1.embeddedScriptPrompt)(hasDynamicParameters, apiNames, useData, this.useIteration);
119897
+ return (0, dedent_1.default)`${systemPrompt}${examples}`;
119865
119898
  }
119866
119899
  async generate(params) {
119867
119900
  const { blueprint } = params;
119868
- const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.EmbeddedScript]);
119869
119901
  const hasDynamicParameters = (0, prompt_selectors_1.shouldUseDynamicParametersPrompt)(params);
119870
119902
  const apiNames = (0, api_1.extractApiNames)(params.extension);
119871
119903
  const useData = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
119872
- const systemPrompt = `${this.buildSystemPrompt(hasDynamicParameters, apiNames, useData)}
119873
- ${examples}
119874
- `;
119904
+ const systemPrompt = this.buildSystemPrompt(hasDynamicParameters, apiNames, useData);
119875
119905
  const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
119876
119906
  const primaryAction = `Customize the Wix CLI embedded script scaffolding for the app ${appName}`;
119877
119907
  const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
@@ -120123,6 +120153,9 @@ var require_formatExtensions = __commonJS({
120123
120153
  var require_IterationAgent = __commonJS({
120124
120154
  "dist/agents/Iteration/IterationAgent.js"(exports2) {
120125
120155
  "use strict";
120156
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
120157
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
120158
+ };
120126
120159
  Object.defineProperty(exports2, "__esModule", { value: true });
120127
120160
  exports2.IterationAgent = void 0;
120128
120161
  var anthropic_1 = require_dist6();
@@ -120134,6 +120167,7 @@ var require_IterationAgent = __commonJS({
120134
120167
  var codegen_common_logic_1 = require_dist11();
120135
120168
  var ditto_codegen_types_2 = require_dist();
120136
120169
  var formatExtensions_1 = require_formatExtensions();
120170
+ var dedent_1 = __importDefault2(require_dedent());
120137
120171
  var supportedExtensionTypes = (0, AgentsRegistry_1.getSupportedExtensionTypes)();
120138
120172
  var CurrentExtensionSchema = zod_1.z.object({
120139
120173
  extensionType: zod_1.z.enum(codegen_common_logic_1.codeGenerationExtensionTypes).describe("The extension kind to trigger"),
@@ -120159,7 +120193,7 @@ var require_IterationAgent = __commonJS({
120159
120193
  this.name = "IterationAgent";
120160
120194
  }
120161
120195
  buildSystemPrompt() {
120162
- return (0, iterationAgentPrompt_1.iterationAgentPrompt)();
120196
+ return (0, dedent_1.default)`${(0, iterationAgentPrompt_1.iterationAgentPrompt)()}`;
120163
120197
  }
120164
120198
  mapExtensionType(extensionType) {
120165
120199
  if (supportedExtensionTypes.includes(extensionType)) {
@@ -120441,6 +120475,9 @@ Also include the relevantCollectionId with the collection ID that matches the sc
120441
120475
  var require_DashboardDecisionAgent = __commonJS({
120442
120476
  "dist/agents/DashboardDecisionAgent.js"(exports2) {
120443
120477
  "use strict";
120478
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
120479
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
120480
+ };
120444
120481
  Object.defineProperty(exports2, "__esModule", { value: true });
120445
120482
  exports2.DashboardDecisionAgent = void 0;
120446
120483
  var anthropic_1 = require_dist6();
@@ -120451,6 +120488,7 @@ var require_DashboardDecisionAgent = __commonJS({
120451
120488
  var prompt_selectors_1 = require_prompt_selectors();
120452
120489
  var types_1 = require_types_impl();
120453
120490
  var userPrompt_1 = require_userPrompt();
120491
+ var dedent_1 = __importDefault2(require_dedent());
120454
120492
  var autoPatternsLlmConfig = zod_1.z.object({
120455
120493
  useAutoPatterns: zod_1.z.boolean(),
120456
120494
  schema: zod_1.z.object({
@@ -120506,7 +120544,7 @@ var require_DashboardDecisionAgent = __commonJS({
120506
120544
  this.name = "DashboardDecisionAgent";
120507
120545
  }
120508
120546
  buildSystemPrompt() {
120509
- return (0, autoPatternPrompt_1.autoPatternDecisionPrompt)();
120547
+ return (0, dedent_1.default)`${(0, autoPatternPrompt_1.autoPatternDecisionPrompt)()}`;
120510
120548
  }
120511
120549
  shouldNotUseAutoPatterns(params) {
120512
120550
  const { blueprint } = params;
@@ -121741,7 +121779,7 @@ var require_AgentsFactory = __commonJS({
121741
121779
  case types_1.ExtensionType.EMBEDDED_SCRIPT:
121742
121780
  return this.getCodeGenerationAgent(extension.type);
121743
121781
  case "PLANNER":
121744
- return new PlannerAgent_1.PlannerAgent(this.apiKey);
121782
+ return new PlannerAgent_1.PlannerAgent(this.apiKey, this.useIteration);
121745
121783
  case "ITERATION_AGENT":
121746
121784
  return new IterationAgent_1.IterationAgent(this.apiKey);
121747
121785
  case "DASHBOARD_DECISION":
@@ -130780,12 +130818,16 @@ var require_ValidatorFactory = __commonJS({
130780
130818
  var require_NaiveFixerAgent = __commonJS({
130781
130819
  "dist/agents/NaiveFixerAgent.js"(exports2) {
130782
130820
  "use strict";
130821
+ var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
130822
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
130823
+ };
130783
130824
  Object.defineProperty(exports2, "__esModule", { value: true });
130784
130825
  exports2.NaiveFixerAgent = void 0;
130785
130826
  var zod_1 = require_zod();
130786
130827
  var ai_1 = require_dist9();
130787
130828
  var anthropic_1 = require_dist6();
130788
130829
  var ditto_codegen_types_12 = require_dist();
130830
+ var dedent_1 = __importDefault2(require_dedent());
130789
130831
  var BatchFixSchema = zod_1.z.object({
130790
130832
  fixedContent: zod_1.z.string().describe("The complete fixed file content with all errors resolved"),
130791
130833
  summary: zod_1.z.string().describe("Brief summary of what was fixed in the file")
@@ -130795,7 +130837,7 @@ var require_NaiveFixerAgent = __commonJS({
130795
130837
  this.apiKey = apiKey;
130796
130838
  }
130797
130839
  async fixFileWithMultipleErrors(input) {
130798
- const system = `You are an expert TypeScript/JavaScript developer. Your task is to fix ALL compilation errors in a file by providing the complete corrected file content.
130840
+ const system = (0, dedent_1.default)`You are an expert TypeScript/JavaScript developer. Your task is to fix ALL compilation errors in a file by providing the complete corrected file content.
130799
130841
 
130800
130842
  Key principles:
130801
130843
  1. Fix ALL errors listed in the input
@@ -351491,7 +351533,6 @@ var require_IterationOrchestrator = __commonJS({
351491
351533
  extensions
351492
351534
  };
351493
351535
  const plan = await planner.generate(blueprint, {
351494
- isIteration: true,
351495
351536
  previousResources
351496
351537
  });
351497
351538
  console.log("Iteration Plan", JSON.stringify(plan, null, 2));