@wix/ditto-codegen-public 1.0.60 → 1.0.61
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 +28 -6
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -123219,22 +123219,26 @@ var require_PlannerAgent = __commonJS({
|
|
|
123219
123219
|
buildSystemPrompt(hasEmbeddedScriptExtensions, hasBackendApiExtensions) {
|
|
123220
123220
|
return (0, planner_1.plannerPrompt)(hasEmbeddedScriptExtensions, hasBackendApiExtensions);
|
|
123221
123221
|
}
|
|
123222
|
-
async
|
|
123223
|
-
const
|
|
123224
|
-
|
|
123225
|
-
|
|
123222
|
+
async generatePlan(systemPrompt, blueprint, model, error) {
|
|
123223
|
+
const userContent = `
|
|
123224
|
+
${JSON.stringify(blueprint, null, 2)}
|
|
123225
|
+
${error ? `
|
|
123226
|
+
|
|
123227
|
+
The previous attempt failed with the following error:
|
|
123228
|
+
${error}` : ""}
|
|
123229
|
+
`;
|
|
123226
123230
|
const result = await (0, ai_1.generateObject)({
|
|
123227
123231
|
model,
|
|
123228
123232
|
schema: exports2.PlannerOutputSchema,
|
|
123229
123233
|
messages: [
|
|
123230
123234
|
{
|
|
123231
123235
|
role: "system",
|
|
123232
|
-
content:
|
|
123236
|
+
content: systemPrompt,
|
|
123233
123237
|
providerOptions: (0, utils_1.withCaching)("1h")
|
|
123234
123238
|
},
|
|
123235
123239
|
{
|
|
123236
123240
|
role: "user",
|
|
123237
|
-
content:
|
|
123241
|
+
content: userContent
|
|
123238
123242
|
}
|
|
123239
123243
|
],
|
|
123240
123244
|
maxRetries: 3,
|
|
@@ -123246,6 +123250,24 @@ var require_PlannerAgent = __commonJS({
|
|
|
123246
123250
|
});
|
|
123247
123251
|
return result.object;
|
|
123248
123252
|
}
|
|
123253
|
+
async generate(blueprint) {
|
|
123254
|
+
const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-3-5-haiku-latest");
|
|
123255
|
+
const hasEmbeddedScriptExtensions = blueprint?.extensions?.some((ext) => ext.type === types_1.ExtensionType.EMBEDDED_SCRIPT) ?? false;
|
|
123256
|
+
const hasBackendApiExtensions = blueprint?.extensions?.some((ext) => ext.type === types_1.ExtensionType.BACKEND_API) ?? false;
|
|
123257
|
+
const systemPrompt = this.buildSystemPrompt(hasEmbeddedScriptExtensions, hasBackendApiExtensions);
|
|
123258
|
+
let lastError;
|
|
123259
|
+
for (let i = 0; i < 3; i++) {
|
|
123260
|
+
try {
|
|
123261
|
+
const result = await this.generatePlan(systemPrompt, blueprint, model, lastError);
|
|
123262
|
+
return result;
|
|
123263
|
+
} catch (error) {
|
|
123264
|
+
lastError = (0, utils_1.getErrorMessage)(error);
|
|
123265
|
+
console.error(`Error generating plan (attempt ${i + 1}): ${error}`);
|
|
123266
|
+
continue;
|
|
123267
|
+
}
|
|
123268
|
+
}
|
|
123269
|
+
throw new Error("Failed to generate plan after 3 attempts");
|
|
123270
|
+
}
|
|
123249
123271
|
};
|
|
123250
123272
|
exports2.PlannerAgent = PlannerAgent;
|
|
123251
123273
|
exports2.default = PlannerAgent;
|
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.61",
|
|
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": "1cbfc2942edfe3093441ce1fdade4ad8e33e61a93b4d586c40560da7"
|
|
28
28
|
}
|