@wix/ditto-codegen-public 1.0.136 → 1.0.137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/ProductChat.tsx +26 -20
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.tsx +12 -11
- package/dist/out.js +213 -170
- package/package.json +2 -2
- package/dist/examples-apps/ai-chatbot/src/backend/api/chat/api.ts +0 -62
- package/dist/examples-apps/ai-chatbot/src/backend/api/settings/api.ts +0 -39
- package/dist/examples-apps/ai-chatbot/src/backend/database.ts +0 -86
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.json +0 -6
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.json +0 -6
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.tsx +0 -105
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/wix_logo.svg +0 -18
- package/dist/examples-apps/ai-chatbot/src/dashboard/utils.ts +0 -27
- package/dist/examples-apps/custom-products-catalog/.nvmrc +0 -1
- package/dist/examples-apps/custom-products-catalog/README.md +0 -21
- package/dist/examples-apps/custom-products-catalog/package-lock.json +0 -8694
- package/dist/examples-apps/custom-products-catalog/package.json +0 -33
- package/dist/examples-apps/custom-products-catalog/src/dashboard/components/create-product.tsx +0 -54
- package/dist/examples-apps/custom-products-catalog/src/dashboard/hooks/stores.ts +0 -60
- package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.json +0 -5
- package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.tsx +0 -297
- package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/wix_logo.svg +0 -18
- package/dist/examples-apps/custom-products-catalog/src/dashboard/withProviders.tsx +0 -16
- package/dist/examples-apps/custom-products-catalog/src/env.d.ts +0 -4
- package/dist/examples-apps/custom-products-catalog/tsconfig.json +0 -8
- package/dist/examples-apps/custom-products-catalog/wix.config.json +0 -5
- package/dist/examples-apps/site-popup/.nvmrc +0 -1
- package/dist/examples-apps/site-popup/README.md +0 -21
- package/dist/examples-apps/site-popup/package.json +0 -51
- package/dist/examples-apps/site-popup/src/components/activation-configuration.tsx +0 -49
- package/dist/examples-apps/site-popup/src/components/close-button.css +0 -33
- package/dist/examples-apps/site-popup/src/components/close-button.tsx +0 -31
- package/dist/examples-apps/site-popup/src/components/date-range-picker.tsx +0 -49
- package/dist/examples-apps/site-popup/src/components/image-picker.tsx +0 -33
- package/dist/examples-apps/site-popup/src/components/popup/index.css +0 -133
- package/dist/examples-apps/site-popup/src/components/popup/index.tsx +0 -71
- package/dist/examples-apps/site-popup/src/components/site-popup-settings.tsx +0 -120
- package/dist/examples-apps/site-popup/src/dashboard/hooks/wix-embeds.ts +0 -33
- package/dist/examples-apps/site-popup/src/dashboard/pages/page.tsx +0 -78
- package/dist/examples-apps/site-popup/src/dashboard/withProviders.tsx +0 -22
- package/dist/examples-apps/site-popup/src/extensions.ts +0 -20
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.html +0 -13
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.css +0 -21
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.tsx +0 -57
- package/dist/examples-apps/site-popup/src/types.ts +0 -14
- package/dist/examples-apps/site-popup/tsconfig.json +0 -9
- package/dist/examples-apps/site-popup/wix.config.json +0 -5
- package/dist/examples-apps/spis-examples/src/dashboard/pages/page.tsx +0 -59
- package/dist/examples-apps/spis-examples/src/dashboard/pages/wix_logo.svg +0 -18
- package/dist/examples-apps/top-blog-posts/.nvmrc +0 -1
- package/dist/examples-apps/top-blog-posts/README.md +0 -21
- package/dist/examples-apps/top-blog-posts/package-lock.json +0 -6406
- package/dist/examples-apps/top-blog-posts/package.json +0 -31
- package/dist/examples-apps/top-blog-posts/src/dashboard/pages/blog-utils.ts +0 -44
- package/dist/examples-apps/top-blog-posts/src/dashboard/pages/page.tsx +0 -129
- package/dist/examples-apps/top-blog-posts/src/dashboard/pages/wix_logo.svg +0 -18
- package/dist/examples-apps/top-blog-posts/src/env.d.ts +0 -4
- package/dist/examples-apps/top-blog-posts/tsconfig.json +0 -8
- 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.
|
|
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
|
|
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
|
|
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
|
|
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 (!
|
|
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 {
|
|
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
|
|
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 =
|
|
117878
|
+
exports2.loadExamples = void 0;
|
|
117799
117879
|
var fs_1 = __importDefault2(require("fs"));
|
|
117800
117880
|
var path_1 = __importDefault2(require("path"));
|
|
117801
|
-
var
|
|
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
|
-
[
|
|
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/
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
118020
|
+
[types_1.ExtensionType.EMBEDDED_SCRIPT]: [
|
|
118014
118021
|
appsExamples.MixPanelAnalystic,
|
|
118015
|
-
appsExamples.SitePopup,
|
|
118016
118022
|
appsExamples.CouponPopup,
|
|
118017
118023
|
appsExamples.EventCountdown
|
|
118018
118024
|
],
|
|
118019
|
-
[
|
|
118020
|
-
[
|
|
118021
|
-
[
|
|
118022
|
-
[
|
|
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 = (
|
|
118033
|
+
var loadExamples = (extensionType) => {
|
|
118028
118034
|
const examplesAppsBasePath = path_1.default.join(__dirname, "examples-apps");
|
|
118029
|
-
|
|
118030
|
-
|
|
118031
|
-
|
|
118032
|
-
|
|
118033
|
-
|
|
118034
|
-
|
|
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
|
-
|
|
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");
|
|
@@ -118685,6 +118684,9 @@ To modify a file, you can either use the 'edit' operation to replace a specific
|
|
|
118685
118684
|
var require_DashboardPageAgent2 = __commonJS({
|
|
118686
118685
|
"dist/agents/DashboardPageAgent.js"(exports2) {
|
|
118687
118686
|
"use strict";
|
|
118687
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
118688
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
118689
|
+
};
|
|
118688
118690
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
118689
118691
|
exports2.DashboardPageAgent = void 0;
|
|
118690
118692
|
var dashboardPagePrompt_1 = require_dashboardPagePrompt();
|
|
@@ -118697,6 +118699,8 @@ var require_DashboardPageAgent2 = __commonJS({
|
|
|
118697
118699
|
var userPrompt_1 = require_userPrompt();
|
|
118698
118700
|
var ditto_codegen_types_12 = require_dist();
|
|
118699
118701
|
var file_operations_1 = require_file_operations();
|
|
118702
|
+
var types_1 = require_types_impl();
|
|
118703
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
118700
118704
|
var DashboardPageAgent = class {
|
|
118701
118705
|
constructor(apiKey, useIteration = false) {
|
|
118702
118706
|
this.apiKey = apiKey;
|
|
@@ -118707,18 +118711,25 @@ var require_DashboardPageAgent2 = __commonJS({
|
|
|
118707
118711
|
return (0, codegen_common_logic_1.getDashboardPageAgentDocumentation)();
|
|
118708
118712
|
}
|
|
118709
118713
|
async buildSystemPrompt(opts) {
|
|
118710
|
-
|
|
118714
|
+
const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.DASHBOARD_PAGE);
|
|
118715
|
+
const systemPrompt = await (0, dashboardPagePrompt_1.dashboardPagePrompt)({
|
|
118716
|
+
...opts,
|
|
118717
|
+
useIteration: this.useIteration
|
|
118718
|
+
});
|
|
118719
|
+
return (0, dedent_1.default)`${systemPrompt}${examples}`;
|
|
118711
118720
|
}
|
|
118712
118721
|
async generate(params) {
|
|
118713
118722
|
const { blueprint, plan } = params;
|
|
118714
|
-
const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.DashboardPage]);
|
|
118715
118723
|
const useData = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
|
|
118716
118724
|
const useApiSpec = Boolean(plan?.apiSpec);
|
|
118717
118725
|
const useDynamicParameters = (0, prompt_selectors_1.shouldUseDynamicParametersPrompt)(params);
|
|
118718
118726
|
const apiNames = (0, api_1.extractApiNames)(params.extension);
|
|
118719
|
-
const systemPrompt =
|
|
118720
|
-
|
|
118721
|
-
|
|
118727
|
+
const systemPrompt = await this.buildSystemPrompt({
|
|
118728
|
+
useData,
|
|
118729
|
+
useApiSpec,
|
|
118730
|
+
useDynamicParameters,
|
|
118731
|
+
apiNames
|
|
118732
|
+
});
|
|
118722
118733
|
const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
|
|
118723
118734
|
const primaryAction = `Customize the Wix CLI dashboard page scaffolding for the app ${appName}`;
|
|
118724
118735
|
const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
|
|
@@ -118761,7 +118772,7 @@ var require_siteComponentPrompt = __commonJS({
|
|
|
118761
118772
|
var apiDocLoader_1 = require_apiDocLoader();
|
|
118762
118773
|
var contextExplanation_1 = require_contextExplanation();
|
|
118763
118774
|
var corePrinciples_1 = require_corePrinciples();
|
|
118764
|
-
var siteComponentPrompt =
|
|
118775
|
+
var siteComponentPrompt = (apiNames, useData, useIteration) => {
|
|
118765
118776
|
const apiDocs = (0, apiDocLoader_1.loadApiDocumentation)(apiNames, useData, useIteration);
|
|
118766
118777
|
const contextExplanation = (0, contextExplanation_1.getContextExplanation)({
|
|
118767
118778
|
supportsCollections: useData,
|
|
@@ -118819,6 +118830,9 @@ var require_siteComponentPrompt = __commonJS({
|
|
|
118819
118830
|
var require_SiteComponentAgent2 = __commonJS({
|
|
118820
118831
|
"dist/agents/SiteComponentAgent.js"(exports2) {
|
|
118821
118832
|
"use strict";
|
|
118833
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
118834
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
118835
|
+
};
|
|
118822
118836
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
118823
118837
|
exports2.SiteComponentAgent = void 0;
|
|
118824
118838
|
var anthropic_1 = require_dist6();
|
|
@@ -118829,6 +118843,7 @@ var require_SiteComponentAgent2 = __commonJS({
|
|
|
118829
118843
|
var userPrompt_1 = require_userPrompt();
|
|
118830
118844
|
var ditto_codegen_types_12 = require_dist();
|
|
118831
118845
|
var file_operations_1 = require_file_operations();
|
|
118846
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
118832
118847
|
var SiteComponentAgent = class {
|
|
118833
118848
|
constructor(apiKey, useIteration = false) {
|
|
118834
118849
|
this.apiKey = apiKey;
|
|
@@ -118838,14 +118853,14 @@ var require_SiteComponentAgent2 = __commonJS({
|
|
|
118838
118853
|
getAgentDocumentation() {
|
|
118839
118854
|
return (0, codegen_common_logic_1.getSiteComponentAgentDocumentation)();
|
|
118840
118855
|
}
|
|
118841
|
-
|
|
118842
|
-
return (0, siteComponentPrompt_1.siteComponentPrompt)(apiNames, useData, this.useIteration)
|
|
118856
|
+
buildSystemPrompt(apiNames, useData) {
|
|
118857
|
+
return (0, dedent_1.default)`${(0, siteComponentPrompt_1.siteComponentPrompt)(apiNames, useData, this.useIteration)}`;
|
|
118843
118858
|
}
|
|
118844
118859
|
async generate(params) {
|
|
118845
118860
|
const { blueprint, plan } = params;
|
|
118846
118861
|
const allApiNames = (0, api_1.extractApiNames)(params.extension);
|
|
118847
118862
|
const useData = Boolean(plan?.collections?.length);
|
|
118848
|
-
const systemPrompt =
|
|
118863
|
+
const systemPrompt = this.buildSystemPrompt(allApiNames, useData);
|
|
118849
118864
|
const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
|
|
118850
118865
|
const primaryAction = `Customize the Wix CLI site component scaffolding for the app ${appName}`;
|
|
118851
118866
|
const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
|
|
@@ -118888,7 +118903,7 @@ var require_customElementPrompt = __commonJS({
|
|
|
118888
118903
|
var apiDocLoader_1 = require_apiDocLoader();
|
|
118889
118904
|
var contextExplanation_1 = require_contextExplanation();
|
|
118890
118905
|
var corePrinciples_1 = require_corePrinciples();
|
|
118891
|
-
var customElementPrompt =
|
|
118906
|
+
var customElementPrompt = (apiNames, useData, useIteration) => {
|
|
118892
118907
|
const contextExplanation = (0, contextExplanation_1.getContextExplanation)({
|
|
118893
118908
|
supportsCollections: useData,
|
|
118894
118909
|
supportsEmbeddedScriptParameters: false
|
|
@@ -118946,6 +118961,9 @@ var require_customElementPrompt = __commonJS({
|
|
|
118946
118961
|
var require_CustomElementAgent2 = __commonJS({
|
|
118947
118962
|
"dist/agents/CustomElementAgent.js"(exports2) {
|
|
118948
118963
|
"use strict";
|
|
118964
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
118965
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
118966
|
+
};
|
|
118949
118967
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
118950
118968
|
exports2.CustomElementAgent = void 0;
|
|
118951
118969
|
var anthropic_1 = require_dist6();
|
|
@@ -118957,6 +118975,8 @@ var require_CustomElementAgent2 = __commonJS({
|
|
|
118957
118975
|
var codegen_common_logic_1 = require_dist11();
|
|
118958
118976
|
var userPrompt_1 = require_userPrompt();
|
|
118959
118977
|
var file_operations_1 = require_file_operations();
|
|
118978
|
+
var types_1 = require_types_impl();
|
|
118979
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
118960
118980
|
var CustomElementAgent = class {
|
|
118961
118981
|
constructor(apiKey, useIteration = false) {
|
|
118962
118982
|
this.apiKey = apiKey;
|
|
@@ -118966,17 +118986,16 @@ var require_CustomElementAgent2 = __commonJS({
|
|
|
118966
118986
|
getAgentDocumentation() {
|
|
118967
118987
|
return (0, codegen_common_logic_1.getCustomElementAgentDocumentation)();
|
|
118968
118988
|
}
|
|
118969
|
-
|
|
118970
|
-
|
|
118989
|
+
buildSystemPrompt(apiNames, useData) {
|
|
118990
|
+
const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.SITE_WIDGET);
|
|
118991
|
+
const systemPrompt = (0, customElementPrompt_1.customElementPrompt)(apiNames, useData, this.useIteration);
|
|
118992
|
+
return (0, dedent_1.default)`${systemPrompt}${examples}`;
|
|
118971
118993
|
}
|
|
118972
118994
|
async generate(params) {
|
|
118973
118995
|
const { blueprint, plan } = params;
|
|
118974
|
-
const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.CustomElementWidget]);
|
|
118975
118996
|
const allApiNames = (0, api_1.extractApiNames)(params.extension);
|
|
118976
118997
|
const useData = Boolean(plan?.collections?.length);
|
|
118977
|
-
const systemPrompt =
|
|
118978
|
-
${examples}
|
|
118979
|
-
`;
|
|
118998
|
+
const systemPrompt = this.buildSystemPrompt(allApiNames, useData);
|
|
118980
118999
|
const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
|
|
118981
119000
|
const primaryAction = `Customize the Wix CLI custom element / site widget scaffolding for the app ${appName}`;
|
|
118982
119001
|
const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
|
|
@@ -119227,6 +119246,9 @@ ${apiDocs}
|
|
|
119227
119246
|
var require_SPIAgent2 = __commonJS({
|
|
119228
119247
|
"dist/agents/SPIAgent.js"(exports2) {
|
|
119229
119248
|
"use strict";
|
|
119249
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
119250
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
119251
|
+
};
|
|
119230
119252
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
119231
119253
|
exports2.SPIAgent = void 0;
|
|
119232
119254
|
var servicePluginPrompt_1 = require_servicePluginPrompt();
|
|
@@ -119239,6 +119261,8 @@ var require_SPIAgent2 = __commonJS({
|
|
|
119239
119261
|
var codegen_common_logic_1 = require_dist11();
|
|
119240
119262
|
var userPrompt_1 = require_userPrompt();
|
|
119241
119263
|
var file_operations_1 = require_file_operations();
|
|
119264
|
+
var types_1 = require_types_impl();
|
|
119265
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
119242
119266
|
var SPIAgent = class {
|
|
119243
119267
|
constructor(apiKey, useIteration = false) {
|
|
119244
119268
|
this.apiKey = apiKey;
|
|
@@ -119249,17 +119273,16 @@ var require_SPIAgent2 = __commonJS({
|
|
|
119249
119273
|
return (0, codegen_common_logic_1.getSPIAgentDocumentation)();
|
|
119250
119274
|
}
|
|
119251
119275
|
buildSystemPrompt(spiNames = [], apiNames = [], useData) {
|
|
119252
|
-
|
|
119276
|
+
const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.SERVICE_PLUGIN);
|
|
119277
|
+
const systemPrompt = (0, servicePluginPrompt_1.getServicePluginPrompt)(spiNames, apiNames, useData, this.useIteration);
|
|
119278
|
+
return (0, dedent_1.default)`${systemPrompt}${examples}`;
|
|
119253
119279
|
}
|
|
119254
119280
|
async generate(params) {
|
|
119255
119281
|
const { extension, blueprint } = params;
|
|
119256
|
-
const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.ServicePluginExtension]);
|
|
119257
119282
|
const allSpiNames = extension.relatedSpis?.map((spi) => spi.name).filter((name) => !!name) || [];
|
|
119258
119283
|
const apiNames = (0, api_1.extractApiNames)(params.extension);
|
|
119259
119284
|
const useData = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
|
|
119260
|
-
const systemPrompt =
|
|
119261
|
-
${examples}
|
|
119262
|
-
`;
|
|
119285
|
+
const systemPrompt = this.buildSystemPrompt(allSpiNames, apiNames, useData);
|
|
119263
119286
|
const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
|
|
119264
119287
|
const primaryAction = `Customize the Wix CLI service plugin scaffolding for the app ${appName}`;
|
|
119265
119288
|
const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
|
|
@@ -119361,6 +119384,9 @@ ${apiDocs}
|
|
|
119361
119384
|
var require_BackendEventAgent2 = __commonJS({
|
|
119362
119385
|
"dist/agents/BackendEventAgent.js"(exports2) {
|
|
119363
119386
|
"use strict";
|
|
119387
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
119388
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
119389
|
+
};
|
|
119364
119390
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
119365
119391
|
exports2.BackendEventAgent = void 0;
|
|
119366
119392
|
var anthropic_1 = require_dist6();
|
|
@@ -119373,6 +119399,8 @@ var require_BackendEventAgent2 = __commonJS({
|
|
|
119373
119399
|
var codegen_common_logic_1 = require_dist11();
|
|
119374
119400
|
var userPrompt_1 = require_userPrompt();
|
|
119375
119401
|
var file_operations_1 = require_file_operations();
|
|
119402
|
+
var types_1 = require_types_impl();
|
|
119403
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
119376
119404
|
var BackendEventAgent = class {
|
|
119377
119405
|
constructor(apiKey, useIteration = false) {
|
|
119378
119406
|
this.apiKey = apiKey;
|
|
@@ -119383,16 +119411,15 @@ var require_BackendEventAgent2 = __commonJS({
|
|
|
119383
119411
|
return (0, codegen_common_logic_1.getBackendEventAgentDocumentation)();
|
|
119384
119412
|
}
|
|
119385
119413
|
buildSystemPrompt(apiNames = [], useData) {
|
|
119386
|
-
|
|
119414
|
+
const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.BACKEND_EVENT);
|
|
119415
|
+
const systemPrompt = (0, backendEventPrompt_1.backendEventPrompt)(apiNames, useData, this.useIteration);
|
|
119416
|
+
return (0, dedent_1.default)`${systemPrompt}${examples}`;
|
|
119387
119417
|
}
|
|
119388
119418
|
async generate(params) {
|
|
119389
119419
|
const { blueprint } = params;
|
|
119390
|
-
const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.BackendEvent]);
|
|
119391
119420
|
const allApiNames = (0, api_1.extractApiNames)(params.extension);
|
|
119392
119421
|
const useData = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
|
|
119393
|
-
const systemPrompt =
|
|
119394
|
-
${examples}
|
|
119395
|
-
`;
|
|
119422
|
+
const systemPrompt = this.buildSystemPrompt(allApiNames, useData);
|
|
119396
119423
|
const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
|
|
119397
119424
|
const primaryAction = `Customize backend event scaffolding for the app ${appName}`;
|
|
119398
119425
|
const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
|
|
@@ -119523,6 +119550,9 @@ ${(0, corePrinciples_1.getCorePrinciples)()}
|
|
|
119523
119550
|
var require_BackendApiAgent2 = __commonJS({
|
|
119524
119551
|
"dist/agents/BackendApiAgent.js"(exports2) {
|
|
119525
119552
|
"use strict";
|
|
119553
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
119554
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
119555
|
+
};
|
|
119526
119556
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
119527
119557
|
exports2.BackendApiAgent = void 0;
|
|
119528
119558
|
var anthropic_1 = require_dist6();
|
|
@@ -119532,6 +119562,7 @@ var require_BackendApiAgent2 = __commonJS({
|
|
|
119532
119562
|
var codegen_common_logic_1 = require_dist11();
|
|
119533
119563
|
var userPrompt_1 = require_userPrompt();
|
|
119534
119564
|
var file_operations_1 = require_file_operations();
|
|
119565
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
119535
119566
|
var BackendApiAgent = class {
|
|
119536
119567
|
constructor(apiKey) {
|
|
119537
119568
|
this.apiKey = apiKey;
|
|
@@ -119541,7 +119572,7 @@ var require_BackendApiAgent2 = __commonJS({
|
|
|
119541
119572
|
return (0, codegen_common_logic_1.getBackendApiAgentDocumentation)();
|
|
119542
119573
|
}
|
|
119543
119574
|
buildSystemPrompt() {
|
|
119544
|
-
return (0, backendApi_1.backendApiPrompt)()
|
|
119575
|
+
return (0, dedent_1.default)`${(0, backendApi_1.backendApiPrompt)()}`;
|
|
119545
119576
|
}
|
|
119546
119577
|
async generate(params) {
|
|
119547
119578
|
const { blueprint } = params;
|
|
@@ -119833,6 +119864,8 @@ var require_EmbeddedScriptAgent2 = __commonJS({
|
|
|
119833
119864
|
var codegen_common_logic_1 = require_dist11();
|
|
119834
119865
|
var userPrompt_1 = require_userPrompt();
|
|
119835
119866
|
var file_operations_1 = require_file_operations();
|
|
119867
|
+
var types_1 = require_types_impl();
|
|
119868
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
119836
119869
|
var EmbeddedScriptPlacement;
|
|
119837
119870
|
(function(EmbeddedScriptPlacement2) {
|
|
119838
119871
|
EmbeddedScriptPlacement2["HEAD"] = "HEAD";
|
|
@@ -119861,17 +119894,16 @@ var require_EmbeddedScriptAgent2 = __commonJS({
|
|
|
119861
119894
|
return (0, codegen_common_logic_1.getEmbeddedScriptAgentDocumentation)();
|
|
119862
119895
|
}
|
|
119863
119896
|
buildSystemPrompt(hasDynamicParameters, apiNames, useData) {
|
|
119864
|
-
|
|
119897
|
+
const examples = (0, load_examples_1.loadExamples)(types_1.ExtensionType.EMBEDDED_SCRIPT);
|
|
119898
|
+
const systemPrompt = (0, embededScript_1.embeddedScriptPrompt)(hasDynamicParameters, apiNames, useData, this.useIteration);
|
|
119899
|
+
return (0, dedent_1.default)`${systemPrompt}${examples}`;
|
|
119865
119900
|
}
|
|
119866
119901
|
async generate(params) {
|
|
119867
119902
|
const { blueprint } = params;
|
|
119868
|
-
const examples = (0, load_examples_1.loadExamples)([load_examples_1.types.EmbeddedScript]);
|
|
119869
119903
|
const hasDynamicParameters = (0, prompt_selectors_1.shouldUseDynamicParametersPrompt)(params);
|
|
119870
119904
|
const apiNames = (0, api_1.extractApiNames)(params.extension);
|
|
119871
119905
|
const useData = (0, prompt_selectors_1.shouldUseDataPrompt)(params);
|
|
119872
|
-
const systemPrompt =
|
|
119873
|
-
${examples}
|
|
119874
|
-
`;
|
|
119906
|
+
const systemPrompt = this.buildSystemPrompt(hasDynamicParameters, apiNames, useData);
|
|
119875
119907
|
const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
|
|
119876
119908
|
const primaryAction = `Customize the Wix CLI embedded script scaffolding for the app ${appName}`;
|
|
119877
119909
|
const userMessage = (0, userPrompt_1.buildUserPromptForCodeGenerationAgent)(params, primaryAction);
|
|
@@ -120123,6 +120155,9 @@ var require_formatExtensions = __commonJS({
|
|
|
120123
120155
|
var require_IterationAgent = __commonJS({
|
|
120124
120156
|
"dist/agents/Iteration/IterationAgent.js"(exports2) {
|
|
120125
120157
|
"use strict";
|
|
120158
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
120159
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
120160
|
+
};
|
|
120126
120161
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120127
120162
|
exports2.IterationAgent = void 0;
|
|
120128
120163
|
var anthropic_1 = require_dist6();
|
|
@@ -120134,6 +120169,7 @@ var require_IterationAgent = __commonJS({
|
|
|
120134
120169
|
var codegen_common_logic_1 = require_dist11();
|
|
120135
120170
|
var ditto_codegen_types_2 = require_dist();
|
|
120136
120171
|
var formatExtensions_1 = require_formatExtensions();
|
|
120172
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
120137
120173
|
var supportedExtensionTypes = (0, AgentsRegistry_1.getSupportedExtensionTypes)();
|
|
120138
120174
|
var CurrentExtensionSchema = zod_1.z.object({
|
|
120139
120175
|
extensionType: zod_1.z.enum(codegen_common_logic_1.codeGenerationExtensionTypes).describe("The extension kind to trigger"),
|
|
@@ -120159,7 +120195,7 @@ var require_IterationAgent = __commonJS({
|
|
|
120159
120195
|
this.name = "IterationAgent";
|
|
120160
120196
|
}
|
|
120161
120197
|
buildSystemPrompt() {
|
|
120162
|
-
return (0, iterationAgentPrompt_1.iterationAgentPrompt)()
|
|
120198
|
+
return (0, dedent_1.default)`${(0, iterationAgentPrompt_1.iterationAgentPrompt)()}`;
|
|
120163
120199
|
}
|
|
120164
120200
|
mapExtensionType(extensionType) {
|
|
120165
120201
|
if (supportedExtensionTypes.includes(extensionType)) {
|
|
@@ -120441,6 +120477,9 @@ Also include the relevantCollectionId with the collection ID that matches the sc
|
|
|
120441
120477
|
var require_DashboardDecisionAgent = __commonJS({
|
|
120442
120478
|
"dist/agents/DashboardDecisionAgent.js"(exports2) {
|
|
120443
120479
|
"use strict";
|
|
120480
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
120481
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
120482
|
+
};
|
|
120444
120483
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120445
120484
|
exports2.DashboardDecisionAgent = void 0;
|
|
120446
120485
|
var anthropic_1 = require_dist6();
|
|
@@ -120451,6 +120490,7 @@ var require_DashboardDecisionAgent = __commonJS({
|
|
|
120451
120490
|
var prompt_selectors_1 = require_prompt_selectors();
|
|
120452
120491
|
var types_1 = require_types_impl();
|
|
120453
120492
|
var userPrompt_1 = require_userPrompt();
|
|
120493
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
120454
120494
|
var autoPatternsLlmConfig = zod_1.z.object({
|
|
120455
120495
|
useAutoPatterns: zod_1.z.boolean(),
|
|
120456
120496
|
schema: zod_1.z.object({
|
|
@@ -120506,7 +120546,7 @@ var require_DashboardDecisionAgent = __commonJS({
|
|
|
120506
120546
|
this.name = "DashboardDecisionAgent";
|
|
120507
120547
|
}
|
|
120508
120548
|
buildSystemPrompt() {
|
|
120509
|
-
return (0, autoPatternPrompt_1.autoPatternDecisionPrompt)()
|
|
120549
|
+
return (0, dedent_1.default)`${(0, autoPatternPrompt_1.autoPatternDecisionPrompt)()}`;
|
|
120510
120550
|
}
|
|
120511
120551
|
shouldNotUseAutoPatterns(params) {
|
|
120512
120552
|
const { blueprint } = params;
|
|
@@ -121741,7 +121781,7 @@ var require_AgentsFactory = __commonJS({
|
|
|
121741
121781
|
case types_1.ExtensionType.EMBEDDED_SCRIPT:
|
|
121742
121782
|
return this.getCodeGenerationAgent(extension.type);
|
|
121743
121783
|
case "PLANNER":
|
|
121744
|
-
return new PlannerAgent_1.PlannerAgent(this.apiKey);
|
|
121784
|
+
return new PlannerAgent_1.PlannerAgent(this.apiKey, this.useIteration);
|
|
121745
121785
|
case "ITERATION_AGENT":
|
|
121746
121786
|
return new IterationAgent_1.IterationAgent(this.apiKey);
|
|
121747
121787
|
case "DASHBOARD_DECISION":
|
|
@@ -130780,12 +130820,16 @@ var require_ValidatorFactory = __commonJS({
|
|
|
130780
130820
|
var require_NaiveFixerAgent = __commonJS({
|
|
130781
130821
|
"dist/agents/NaiveFixerAgent.js"(exports2) {
|
|
130782
130822
|
"use strict";
|
|
130823
|
+
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
130824
|
+
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
130825
|
+
};
|
|
130783
130826
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
130784
130827
|
exports2.NaiveFixerAgent = void 0;
|
|
130785
130828
|
var zod_1 = require_zod();
|
|
130786
130829
|
var ai_1 = require_dist9();
|
|
130787
130830
|
var anthropic_1 = require_dist6();
|
|
130788
130831
|
var ditto_codegen_types_12 = require_dist();
|
|
130832
|
+
var dedent_1 = __importDefault2(require_dedent());
|
|
130789
130833
|
var BatchFixSchema = zod_1.z.object({
|
|
130790
130834
|
fixedContent: zod_1.z.string().describe("The complete fixed file content with all errors resolved"),
|
|
130791
130835
|
summary: zod_1.z.string().describe("Brief summary of what was fixed in the file")
|
|
@@ -130795,7 +130839,7 @@ var require_NaiveFixerAgent = __commonJS({
|
|
|
130795
130839
|
this.apiKey = apiKey;
|
|
130796
130840
|
}
|
|
130797
130841
|
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.
|
|
130842
|
+
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
130843
|
|
|
130800
130844
|
Key principles:
|
|
130801
130845
|
1. Fix ALL errors listed in the input
|
|
@@ -351491,7 +351535,6 @@ var require_IterationOrchestrator = __commonJS({
|
|
|
351491
351535
|
extensions
|
|
351492
351536
|
};
|
|
351493
351537
|
const plan = await planner.generate(blueprint, {
|
|
351494
|
-
isIteration: true,
|
|
351495
351538
|
previousResources
|
|
351496
351539
|
});
|
|
351497
351540
|
console.log("Iteration Plan", JSON.stringify(plan, null, 2));
|