@wix/ditto-codegen-public 1.0.53 → 1.0.54
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/out.js +38 -33
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -120290,6 +120290,27 @@ var require_index_node = __commonJS({
|
|
|
120290
120290
|
}
|
|
120291
120291
|
});
|
|
120292
120292
|
|
|
120293
|
+
// dist/system-prompts/apiDocLoader.js
|
|
120294
|
+
var require_apiDocLoader = __commonJS({
|
|
120295
|
+
"dist/system-prompts/apiDocLoader.js"(exports2) {
|
|
120296
|
+
"use strict";
|
|
120297
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120298
|
+
exports2.loadApiDocumentation = loadApiDocumentation;
|
|
120299
|
+
var docLoader_1 = require_docLoader();
|
|
120300
|
+
var API_TO_DOC_MAPPING = {
|
|
120301
|
+
"stores.productsV3.updateProduct": "stores-productsV3-updateProduct-doc.txt",
|
|
120302
|
+
"stores.products.onProductCreated": "stores-productV3-onProductCreated-doc.txt",
|
|
120303
|
+
"data.items.onDataItemCreated": "data-items-onDataItemCreated.txt",
|
|
120304
|
+
"crm.contacts.onContactCreated": "crm-contacts-onContactCreated-doc.txt",
|
|
120305
|
+
"ecom.cart.onCartCreated": "ecom-cart-onCartCreated-doc.txt",
|
|
120306
|
+
"ecom.cart.onCartUpdated": "ecom-cart-onCartUpdated-doc.txt"
|
|
120307
|
+
};
|
|
120308
|
+
function loadApiDocumentation(apiNames) {
|
|
120309
|
+
return (0, docLoader_1.loadDocumentation)(apiNames, API_TO_DOC_MAPPING, docLoader_1.DocType.API);
|
|
120310
|
+
}
|
|
120311
|
+
}
|
|
120312
|
+
});
|
|
120313
|
+
|
|
120293
120314
|
// dist/agents/utils.js
|
|
120294
120315
|
var require_utils14 = __commonJS({
|
|
120295
120316
|
"dist/agents/utils.js"(exports2) {
|
|
@@ -120298,12 +120319,13 @@ var require_utils14 = __commonJS({
|
|
|
120298
120319
|
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
120299
120320
|
};
|
|
120300
120321
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120301
|
-
exports2.getErrorMessage = exports2.buildUserPromptForCodeGenerationAgent = exports2.getHttpClient = exports2.withCaching = exports2.FileSchema = exports2.FileItemSchema = void 0;
|
|
120322
|
+
exports2.extractApiNames = exports2.getErrorMessage = exports2.buildUserPromptForCodeGenerationAgent = exports2.getHttpClient = exports2.withCaching = exports2.FileSchema = exports2.FileItemSchema = void 0;
|
|
120302
120323
|
exports2.loadRelevantFilesAsString = loadRelevantFilesAsString;
|
|
120303
120324
|
var zod_1 = require_zod();
|
|
120304
120325
|
var http_client_1 = require_index_node();
|
|
120305
120326
|
var fs_1 = __importDefault2(require("fs"));
|
|
120306
120327
|
var path_1 = __importDefault2(require("path"));
|
|
120328
|
+
var apiDocLoader_1 = require_apiDocLoader();
|
|
120307
120329
|
exports2.FileItemSchema = zod_1.z.object({
|
|
120308
120330
|
operation: zod_1.z.enum(["insert", "update", "delete"]).describe("File operation: insert (new file), update (modify existing), delete (remove file)").default("insert"),
|
|
120309
120331
|
path: zod_1.z.string().describe("Relative file path from project root").optional(),
|
|
@@ -120411,6 +120433,13 @@ ${JSON.stringify(planAndResources.apiSpec, null, 2)}`);
|
|
|
120411
120433
|
contextSections.push(`
|
|
120412
120434
|
## EMBEDDED SCRIPT PARAMETERS
|
|
120413
120435
|
${JSON.stringify(planAndResources.embeddedScriptParameters, null, 2)}`);
|
|
120436
|
+
}
|
|
120437
|
+
if (extension.relatedApis?.length) {
|
|
120438
|
+
const apiNames = (0, exports2.extractApiNames)(params.extension);
|
|
120439
|
+
const apiDocs = (0, apiDocLoader_1.loadApiDocumentation)(apiNames);
|
|
120440
|
+
contextSections.push(`
|
|
120441
|
+
## RELATED APIS
|
|
120442
|
+
${apiDocs}`);
|
|
120414
120443
|
}
|
|
120415
120444
|
const userMessage = `${primaryAction}:
|
|
120416
120445
|
${contextSections.join("\n")}`;
|
|
@@ -120427,6 +120456,10 @@ ${contextSections.join("\n")}`;
|
|
|
120427
120456
|
}
|
|
120428
120457
|
};
|
|
120429
120458
|
exports2.getErrorMessage = getErrorMessage;
|
|
120459
|
+
var extractApiNames = (extension) => {
|
|
120460
|
+
return extension.relatedApis?.map((api) => api.name).filter((name) => !!name) || [];
|
|
120461
|
+
};
|
|
120462
|
+
exports2.extractApiNames = extractApiNames;
|
|
120430
120463
|
}
|
|
120431
120464
|
});
|
|
120432
120465
|
|
|
@@ -124961,36 +124994,13 @@ var require_SiteComponentAgent = __commonJS({
|
|
|
124961
124994
|
}
|
|
124962
124995
|
});
|
|
124963
124996
|
|
|
124964
|
-
// dist/system-prompts/apiDocLoader.js
|
|
124965
|
-
var require_apiDocLoader = __commonJS({
|
|
124966
|
-
"dist/system-prompts/apiDocLoader.js"(exports2) {
|
|
124967
|
-
"use strict";
|
|
124968
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
124969
|
-
exports2.loadApiDocumentation = loadApiDocumentation;
|
|
124970
|
-
var docLoader_1 = require_docLoader();
|
|
124971
|
-
var API_TO_DOC_MAPPING = {
|
|
124972
|
-
"stores.productsV3.updateProduct": "stores-productsV3-updateProduct-doc.txt",
|
|
124973
|
-
"stores.products.onProductCreated": "stores-productV3-onProductCreated-doc.txt",
|
|
124974
|
-
"data.items.onDataItemCreated": "data-items-onDataItemCreated.txt",
|
|
124975
|
-
"crm.contacts.onContactCreated": "crm-contacts-onContactCreated-doc.txt",
|
|
124976
|
-
"ecom.cart.onCartCreated": "ecom-cart-onCartCreated-doc.txt",
|
|
124977
|
-
"ecom.cart.onCartUpdated": "ecom-cart-onCartUpdated-doc.txt"
|
|
124978
|
-
};
|
|
124979
|
-
function loadApiDocumentation(apiNames) {
|
|
124980
|
-
return (0, docLoader_1.loadDocumentation)(apiNames, API_TO_DOC_MAPPING, docLoader_1.DocType.API);
|
|
124981
|
-
}
|
|
124982
|
-
}
|
|
124983
|
-
});
|
|
124984
|
-
|
|
124985
124997
|
// dist/system-prompts/backendEvent/backendEventPrompt.js
|
|
124986
124998
|
var require_backendEventPrompt = __commonJS({
|
|
124987
124999
|
"dist/system-prompts/backendEvent/backendEventPrompt.js"(exports2) {
|
|
124988
125000
|
"use strict";
|
|
124989
125001
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
124990
125002
|
exports2.backendEventPrompt = void 0;
|
|
124991
|
-
var
|
|
124992
|
-
var backendEventPrompt = (apiNames) => {
|
|
124993
|
-
const apiDocs = (0, apiDocLoader_1.loadApiDocumentation)(apiNames);
|
|
125003
|
+
var backendEventPrompt = () => {
|
|
124994
125004
|
return `<BACKEND_EVENT_PROMPT>
|
|
124995
125005
|
<role>
|
|
124996
125006
|
You are a Wix backend event handler generator. Create event extensions for Wix CLI apps using the JavaScript SDK. Events are triggered when specific conditions on the app or user's site are met.
|
|
@@ -125024,10 +125034,6 @@ You are a Wix backend event handler generator. Create event extensions for Wix C
|
|
|
125024
125034
|
- Reference the corresponding SDK submodule category for event-specific information
|
|
125025
125035
|
- Events run automatically when triggered - no manual invocation needed
|
|
125026
125036
|
</implementation_guidelines>
|
|
125027
|
-
|
|
125028
|
-
<api_docs>
|
|
125029
|
-
${apiDocs}
|
|
125030
|
-
</api_docs>
|
|
125031
125037
|
</BACKEND_EVENT_PROMPT>`;
|
|
125032
125038
|
};
|
|
125033
125039
|
exports2.backendEventPrompt = backendEventPrompt;
|
|
@@ -125087,14 +125093,13 @@ var require_BackendEventAgent = __commonJS({
|
|
|
125087
125093
|
this.apiKey = apiKey;
|
|
125088
125094
|
this.name = "BackendEventAgent";
|
|
125089
125095
|
}
|
|
125090
|
-
buildSystemPrompt(
|
|
125091
|
-
return (0, backendEventPrompt_1.backendEventPrompt)(
|
|
125096
|
+
buildSystemPrompt() {
|
|
125097
|
+
return (0, backendEventPrompt_1.backendEventPrompt)();
|
|
125092
125098
|
}
|
|
125093
125099
|
async generate(params) {
|
|
125094
125100
|
const { blueprint } = params;
|
|
125095
125101
|
const examples = (0, load_examples_1.default)([load_examples_1.types.BackendEvent]);
|
|
125096
|
-
const
|
|
125097
|
-
const systemPrompt = `${this.buildSystemPrompt(allApiNames)}
|
|
125102
|
+
const systemPrompt = `${this.buildSystemPrompt()}
|
|
125098
125103
|
${examples}
|
|
125099
125104
|
`;
|
|
125100
125105
|
const appName = blueprint?.appName ? `'${blueprint.appName}'` : "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/ditto-codegen-public",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@wix/ditto-codegen": "1.0.0",
|
|
25
25
|
"esbuild": "^0.25.9"
|
|
26
26
|
},
|
|
27
|
-
"falconPackageHash": "
|
|
27
|
+
"falconPackageHash": "d1a0ebf97acef33131fa09a202f3c6ccf08a381afd538155ebd4da4d"
|
|
28
28
|
}
|