@wix/ditto-codegen-public 1.0.60 → 1.0.62
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 +150 -71
- 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;
|
|
@@ -137941,6 +137963,49 @@ var require_file_collector = __commonJS({
|
|
|
137941
137963
|
}
|
|
137942
137964
|
});
|
|
137943
137965
|
|
|
137966
|
+
// dist/orchestrator-error-helpers.js
|
|
137967
|
+
var require_orchestrator_error_helpers = __commonJS({
|
|
137968
|
+
"dist/orchestrator-error-helpers.js"(exports2) {
|
|
137969
|
+
"use strict";
|
|
137970
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
137971
|
+
exports2.createExtensionErrorHandler = createExtensionErrorHandler;
|
|
137972
|
+
exports2.throwIfFailures = throwIfFailures;
|
|
137973
|
+
function createExtensionErrorHandler(orchestrator, extension) {
|
|
137974
|
+
return (error) => {
|
|
137975
|
+
const errorObj = error instanceof Error ? error : new Error(String(error));
|
|
137976
|
+
orchestrator.emitEvent("agent:error", {
|
|
137977
|
+
extension,
|
|
137978
|
+
error: errorObj
|
|
137979
|
+
});
|
|
137980
|
+
console.error(`\u274C Failed to process extension ${extension.name}:`, error);
|
|
137981
|
+
throw error;
|
|
137982
|
+
};
|
|
137983
|
+
}
|
|
137984
|
+
function throwIfFailures(results, errorMessagePrefix) {
|
|
137985
|
+
const failures = results.map((result, index) => {
|
|
137986
|
+
if (result.status === "rejected") {
|
|
137987
|
+
return {
|
|
137988
|
+
index,
|
|
137989
|
+
error: result.reason
|
|
137990
|
+
};
|
|
137991
|
+
}
|
|
137992
|
+
return null;
|
|
137993
|
+
}).filter((f) => f !== null);
|
|
137994
|
+
if (failures.length > 0) {
|
|
137995
|
+
const errorMessages = failures.map((f) => `Task ${f.index} failed: ${f.error instanceof Error ? f.error.message : String(f.error)}`);
|
|
137996
|
+
const message = errorMessagePrefix ? `${errorMessagePrefix}
|
|
137997
|
+
${errorMessages.join("\n")}` : `Failed to process ${failures.length} of ${results.length} parallel tasks:
|
|
137998
|
+
${errorMessages.join("\n")}`;
|
|
137999
|
+
const aggregatedError = new Error(message);
|
|
138000
|
+
if (failures[0]?.error instanceof Error) {
|
|
138001
|
+
aggregatedError.stack = failures[0].error.stack;
|
|
138002
|
+
}
|
|
138003
|
+
throw aggregatedError;
|
|
138004
|
+
}
|
|
138005
|
+
}
|
|
138006
|
+
}
|
|
138007
|
+
});
|
|
138008
|
+
|
|
137944
138009
|
// dist/orchestrator.js
|
|
137945
138010
|
var require_orchestrator = __commonJS({
|
|
137946
138011
|
"dist/orchestrator.js"(exports2) {
|
|
@@ -137961,6 +138026,7 @@ var require_orchestrator = __commonJS({
|
|
|
137961
138026
|
var extensionGenerators_1 = require_extensionGenerators();
|
|
137962
138027
|
var extensionIndexer_1 = require_extensionIndexer();
|
|
137963
138028
|
var file_collector_1 = require_file_collector();
|
|
138029
|
+
var orchestrator_error_helpers_1 = require_orchestrator_error_helpers();
|
|
137964
138030
|
var MAX_ERRORS_PER_BATCH = 20;
|
|
137965
138031
|
var DittoOrchestrator = class extends events_1.EventEmitter {
|
|
137966
138032
|
constructor(agentsFactory, apiKey) {
|
|
@@ -138322,7 +138388,8 @@ var require_orchestrator = __commonJS({
|
|
|
138322
138388
|
outputPath
|
|
138323
138389
|
});
|
|
138324
138390
|
});
|
|
138325
|
-
await Promise.
|
|
138391
|
+
const results = await Promise.allSettled(parallelTasks);
|
|
138392
|
+
(0, orchestrator_error_helpers_1.throwIfFailures)(results);
|
|
138326
138393
|
}
|
|
138327
138394
|
async processIterationExtension({ extension, paths, relevantUserRequest, outputPath, newExtension }) {
|
|
138328
138395
|
if (newExtension) {
|
|
@@ -138415,12 +138482,13 @@ var require_orchestrator = __commonJS({
|
|
|
138415
138482
|
blueprint,
|
|
138416
138483
|
outputPath,
|
|
138417
138484
|
planAndResources
|
|
138418
|
-
}));
|
|
138485
|
+
}).catch((0, orchestrator_error_helpers_1.createExtensionErrorHandler)(this, extension)));
|
|
138419
138486
|
const collections = planAndResources.createdCollections ?? [];
|
|
138420
138487
|
if (collections.length > 0 && siteId && siteId !== "N/A" && accessToken) {
|
|
138421
138488
|
parallelTasks.push(this.generateCMSData(request, collections));
|
|
138422
138489
|
}
|
|
138423
|
-
await Promise.
|
|
138490
|
+
const results = await Promise.allSettled(parallelTasks.filter(Boolean));
|
|
138491
|
+
(0, orchestrator_error_helpers_1.throwIfFailures)(results);
|
|
138424
138492
|
await (0, extensionIndexer_1.generateMainExtensionsFile)(outputPath);
|
|
138425
138493
|
const durationMsCodeGeneration = Date.now() - start;
|
|
138426
138494
|
this.emitEvent("finish:code-generation", {
|
|
@@ -138451,7 +138519,7 @@ var require_orchestrator = __commonJS({
|
|
|
138451
138519
|
relevantUserRequest: iterationPlan.summary,
|
|
138452
138520
|
outputPath,
|
|
138453
138521
|
newExtension: true
|
|
138454
|
-
});
|
|
138522
|
+
}).catch((0, orchestrator_error_helpers_1.createExtensionErrorHandler)(this, extension.extension));
|
|
138455
138523
|
}) || [];
|
|
138456
138524
|
if (iterationPlan?.currentExtensions && iterationPlan.currentExtensions.length > 0) {
|
|
138457
138525
|
parallelTasks.push(...iterationPlan.currentExtensions.map((extension) => {
|
|
@@ -138461,10 +138529,11 @@ var require_orchestrator = __commonJS({
|
|
|
138461
138529
|
relevantUserRequest: iterationPlan.summary,
|
|
138462
138530
|
outputPath,
|
|
138463
138531
|
newExtension: false
|
|
138464
|
-
});
|
|
138532
|
+
}).catch((0, orchestrator_error_helpers_1.createExtensionErrorHandler)(this, extension.extension));
|
|
138465
138533
|
}));
|
|
138466
138534
|
}
|
|
138467
|
-
await Promise.
|
|
138535
|
+
const results = await Promise.allSettled(parallelTasks.filter(Boolean));
|
|
138536
|
+
(0, orchestrator_error_helpers_1.throwIfFailures)(results);
|
|
138468
138537
|
await (0, extensionIndexer_1.generateMainExtensionsFile)(outputPath);
|
|
138469
138538
|
const durationMsCodeGeneration = Date.now() - start;
|
|
138470
138539
|
this.emitEvent("finish:code-generation", {
|
|
@@ -138568,52 +138637,88 @@ ${unfixedValidationErrors}`;
|
|
|
138568
138637
|
}
|
|
138569
138638
|
});
|
|
138570
138639
|
|
|
138571
|
-
// dist/flows/
|
|
138572
|
-
var
|
|
138573
|
-
"dist/flows/
|
|
138640
|
+
// dist/flows/codegen-flow-helpers.js
|
|
138641
|
+
var require_codegen_flow_helpers = __commonJS({
|
|
138642
|
+
"dist/flows/codegen-flow-helpers.js"(exports2) {
|
|
138574
138643
|
"use strict";
|
|
138575
138644
|
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
138576
138645
|
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
138577
138646
|
};
|
|
138578
138647
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
138579
|
-
exports2.
|
|
138648
|
+
exports2.setupAgentTaskTracking = setupAgentTaskTracking;
|
|
138649
|
+
exports2.updateParentTaskStatus = updateParentTaskStatus;
|
|
138650
|
+
exports2.getOutputPath = getOutputPath;
|
|
138580
138651
|
var path_1 = __importDefault2(require("path"));
|
|
138581
138652
|
var __1 = require_index();
|
|
138582
|
-
var AgentsFactory_1 = require_AgentsFactory();
|
|
138583
|
-
var cli_listeners_1 = require_cli_listeners();
|
|
138584
|
-
var context_1 = require_context();
|
|
138585
|
-
var job_context_storage_1 = require_job_context_storage();
|
|
138586
138653
|
var orchestrator_1 = require_orchestrator();
|
|
138587
138654
|
var CodeGenService_1 = require_CodeGenService();
|
|
138588
138655
|
var utils_1 = require_utils18();
|
|
138589
138656
|
var slugify = (str = "") => {
|
|
138590
138657
|
return str.toLowerCase().replace(/ /g, "-");
|
|
138591
138658
|
};
|
|
138659
|
+
function setupAgentTaskTracking(orchestrator, jobContext) {
|
|
138660
|
+
const getTaskId = (extension) => {
|
|
138661
|
+
return `${jobContext.taskId}-${slugify(extension.name)}`;
|
|
138662
|
+
};
|
|
138663
|
+
orchestrator.onEvent("agent:start", ({ extension }) => {
|
|
138664
|
+
console.log(`[Agent] start: ${extension.name}`);
|
|
138665
|
+
const taskId = getTaskId(extension);
|
|
138666
|
+
__1.codeGenerationService.addTask(jobContext.jobId, {
|
|
138667
|
+
id: taskId,
|
|
138668
|
+
kind: "run_agent",
|
|
138669
|
+
status: CodeGenService_1.TaskStatus.RUNNING,
|
|
138670
|
+
name: "run_agent",
|
|
138671
|
+
description: `Run agent for ${extension.name}`,
|
|
138672
|
+
payload: { extension }
|
|
138673
|
+
});
|
|
138674
|
+
});
|
|
138675
|
+
orchestrator.onEvent("agent:done", ({ extension, files }) => {
|
|
138676
|
+
console.log(`[Agent] done: ${extension.name}`);
|
|
138677
|
+
const taskId = getTaskId(extension);
|
|
138678
|
+
__1.codeGenerationService.updateTask(jobContext.jobId, taskId, CodeGenService_1.TaskStatus.COMPLETED, { taskOutput: { files } });
|
|
138679
|
+
});
|
|
138680
|
+
orchestrator.onEvent("agent:error", async ({ extension, error }) => {
|
|
138681
|
+
console.error(`[Agent] error: ${extension.name}`, error);
|
|
138682
|
+
const taskId = getTaskId(extension);
|
|
138683
|
+
await __1.codeGenerationService.updateTask(jobContext.jobId, taskId, CodeGenService_1.TaskStatus.FAILED, {
|
|
138684
|
+
error: (0, utils_1.serializeError)(error)
|
|
138685
|
+
});
|
|
138686
|
+
});
|
|
138687
|
+
}
|
|
138688
|
+
async function updateParentTaskStatus(jobContext, status, error) {
|
|
138689
|
+
await __1.codeGenerationService.updateTask(jobContext.jobId, jobContext.taskId, status, error ? { error: (0, utils_1.serializeError)(error) } : {});
|
|
138690
|
+
}
|
|
138691
|
+
function getOutputPath() {
|
|
138692
|
+
const outputDir = process.env.OUTPUT_PATH || orchestrator_1.DittoOrchestrator.DEFAULT_OUTPUT_PATH;
|
|
138693
|
+
return outputDir.startsWith("/") ? outputDir : path_1.default.join(process.cwd(), outputDir);
|
|
138694
|
+
}
|
|
138695
|
+
}
|
|
138696
|
+
});
|
|
138697
|
+
|
|
138698
|
+
// dist/flows/init-codegen.js
|
|
138699
|
+
var require_init_codegen = __commonJS({
|
|
138700
|
+
"dist/flows/init-codegen.js"(exports2) {
|
|
138701
|
+
"use strict";
|
|
138702
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
138703
|
+
exports2.runInitCodegenFlow = void 0;
|
|
138704
|
+
var __1 = require_index();
|
|
138705
|
+
var AgentsFactory_1 = require_AgentsFactory();
|
|
138706
|
+
var cli_listeners_1 = require_cli_listeners();
|
|
138707
|
+
var context_1 = require_context();
|
|
138708
|
+
var job_context_storage_1 = require_job_context_storage();
|
|
138709
|
+
var orchestrator_1 = require_orchestrator();
|
|
138710
|
+
var CodeGenService_1 = require_CodeGenService();
|
|
138711
|
+
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
138592
138712
|
var runInitCodegenFlow = async (blueprint) => {
|
|
138593
138713
|
const localJobContext = job_context_storage_1.jobContextStorage.getStore();
|
|
138594
138714
|
console.log(`[Init] Starting init codegen task: jobId=${localJobContext?.jobId}, taskId=${localJobContext?.taskId}`);
|
|
138595
138715
|
await __1.codeGenerationService.updateTask(localJobContext.jobId, localJobContext.taskId, CodeGenService_1.TaskStatus.RUNNING, {});
|
|
138596
138716
|
console.log(`[Init] Marked task RUNNING: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
|
|
138597
138717
|
try {
|
|
138598
|
-
const
|
|
138599
|
-
const outputPath = outputDir.startsWith("/") ? outputDir : path_1.default.join(process.cwd(), outputDir);
|
|
138718
|
+
const outputPath = (0, codegen_flow_helpers_1.getOutputPath)();
|
|
138600
138719
|
const agentsFactory = new AgentsFactory_1.AgentsFactory(context_1.ctx?.apiKey);
|
|
138601
138720
|
const orchestrator = new orchestrator_1.DittoOrchestrator(agentsFactory, context_1.ctx?.apiKey);
|
|
138602
|
-
|
|
138603
|
-
console.log(`[Agent] start: ${extension.name}`);
|
|
138604
|
-
__1.codeGenerationService.addTask(localJobContext.jobId, {
|
|
138605
|
-
id: `${localJobContext.taskId}-${slugify(extension.name)}`,
|
|
138606
|
-
kind: "run_agent",
|
|
138607
|
-
status: CodeGenService_1.TaskStatus.RUNNING,
|
|
138608
|
-
name: "run_agent",
|
|
138609
|
-
description: `Run agent for ${extension.name}`,
|
|
138610
|
-
payload: { extension }
|
|
138611
|
-
});
|
|
138612
|
-
});
|
|
138613
|
-
orchestrator.onEvent("agent:done", ({ extension, files }) => {
|
|
138614
|
-
console.log(`[Agent] done: ${extension.name}`);
|
|
138615
|
-
__1.codeGenerationService.updateTask(localJobContext.jobId, `${localJobContext.taskId}-${slugify(extension.name)}`, CodeGenService_1.TaskStatus.COMPLETED, { taskOutput: { files } });
|
|
138616
|
-
});
|
|
138721
|
+
(0, codegen_flow_helpers_1.setupAgentTaskTracking)(orchestrator, localJobContext);
|
|
138617
138722
|
(0, cli_listeners_1.attachOrchestratorListeners)(orchestrator);
|
|
138618
138723
|
await orchestrator.generateCode({
|
|
138619
138724
|
blueprint,
|
|
@@ -138621,12 +138726,10 @@ var require_init_codegen = __commonJS({
|
|
|
138621
138726
|
siteId: context_1.ctx.siteId,
|
|
138622
138727
|
accessToken: context_1.ctx.accessToken
|
|
138623
138728
|
});
|
|
138624
|
-
await
|
|
138729
|
+
await (0, codegen_flow_helpers_1.updateParentTaskStatus)(localJobContext, CodeGenService_1.TaskStatus.COMPLETED);
|
|
138625
138730
|
console.log(`[Init] Completed init codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
|
|
138626
138731
|
} catch (error) {
|
|
138627
|
-
await
|
|
138628
|
-
error: (0, utils_1.serializeError)(error)
|
|
138629
|
-
});
|
|
138732
|
+
await (0, codegen_flow_helpers_1.updateParentTaskStatus)(localJobContext, CodeGenService_1.TaskStatus.FAILED, error);
|
|
138630
138733
|
console.error(`\u274C [Init] Failed init codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`, error);
|
|
138631
138734
|
}
|
|
138632
138735
|
};
|
|
@@ -138638,12 +138741,8 @@ var require_init_codegen = __commonJS({
|
|
|
138638
138741
|
var require_iterate_codegen = __commonJS({
|
|
138639
138742
|
"dist/flows/iterate-codegen.js"(exports2) {
|
|
138640
138743
|
"use strict";
|
|
138641
|
-
var __importDefault2 = exports2 && exports2.__importDefault || function(mod2) {
|
|
138642
|
-
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
138643
|
-
};
|
|
138644
138744
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
138645
138745
|
exports2.runIterateCodegenFlow = void 0;
|
|
138646
|
-
var path_1 = __importDefault2(require("path"));
|
|
138647
138746
|
var __1 = require_index();
|
|
138648
138747
|
var AgentsFactory_1 = require_AgentsFactory();
|
|
138649
138748
|
var cli_listeners_1 = require_cli_listeners();
|
|
@@ -138651,35 +138750,17 @@ var require_iterate_codegen = __commonJS({
|
|
|
138651
138750
|
var job_context_storage_1 = require_job_context_storage();
|
|
138652
138751
|
var orchestrator_1 = require_orchestrator();
|
|
138653
138752
|
var CodeGenService_1 = require_CodeGenService();
|
|
138654
|
-
var
|
|
138655
|
-
var slugify = (str = "") => {
|
|
138656
|
-
return str.toLowerCase().replace(/ /g, "-");
|
|
138657
|
-
};
|
|
138753
|
+
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
138658
138754
|
var runIterateCodegenFlow = async (chatHistory) => {
|
|
138659
138755
|
const localJobContext = job_context_storage_1.jobContextStorage.getStore();
|
|
138660
138756
|
console.log(`[Iterate] Starting iterate codegen task: jobId=${localJobContext?.jobId}, taskId=${localJobContext?.taskId}`);
|
|
138661
138757
|
await __1.codeGenerationService.updateTask(localJobContext.jobId, localJobContext.taskId, CodeGenService_1.TaskStatus.RUNNING, {});
|
|
138662
138758
|
console.log(`[Init] Marked task RUNNING: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
|
|
138663
138759
|
try {
|
|
138664
|
-
const
|
|
138665
|
-
const outputPath = outputDir.startsWith("/") ? outputDir : path_1.default.join(process.cwd(), outputDir);
|
|
138760
|
+
const outputPath = (0, codegen_flow_helpers_1.getOutputPath)();
|
|
138666
138761
|
const agentsFactory = new AgentsFactory_1.AgentsFactory(context_1.ctx?.apiKey);
|
|
138667
138762
|
const orchestrator = new orchestrator_1.DittoOrchestrator(agentsFactory, context_1.ctx?.apiKey);
|
|
138668
|
-
|
|
138669
|
-
console.log(`[Agent] start: ${extension.name}`);
|
|
138670
|
-
__1.codeGenerationService.addTask(localJobContext.jobId, {
|
|
138671
|
-
id: `${localJobContext.taskId}-${slugify(extension.name)}`,
|
|
138672
|
-
kind: "run_agent",
|
|
138673
|
-
status: CodeGenService_1.TaskStatus.RUNNING,
|
|
138674
|
-
name: "run_agent",
|
|
138675
|
-
description: `Run agent for ${extension.name}`,
|
|
138676
|
-
payload: { extension }
|
|
138677
|
-
});
|
|
138678
|
-
});
|
|
138679
|
-
orchestrator.onEvent("agent:done", ({ extension, files }) => {
|
|
138680
|
-
console.log(`[Agent] done: ${extension.name}`);
|
|
138681
|
-
__1.codeGenerationService.updateTask(localJobContext.jobId, `${localJobContext.taskId}-${slugify(extension.name)}`, CodeGenService_1.TaskStatus.COMPLETED, { taskOutput: { files } });
|
|
138682
|
-
});
|
|
138763
|
+
(0, codegen_flow_helpers_1.setupAgentTaskTracking)(orchestrator, localJobContext);
|
|
138683
138764
|
(0, cli_listeners_1.attachOrchestratorListeners)(orchestrator);
|
|
138684
138765
|
await orchestrator.generateIterationCode({
|
|
138685
138766
|
chatHistory,
|
|
@@ -138687,13 +138768,11 @@ var require_iterate_codegen = __commonJS({
|
|
|
138687
138768
|
siteId: context_1.ctx.siteId,
|
|
138688
138769
|
accessToken: context_1.ctx.accessToken
|
|
138689
138770
|
});
|
|
138690
|
-
await
|
|
138771
|
+
await (0, codegen_flow_helpers_1.updateParentTaskStatus)(localJobContext, CodeGenService_1.TaskStatus.COMPLETED);
|
|
138691
138772
|
console.log(`[Init] Completed iterate codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
|
|
138692
138773
|
} catch (error) {
|
|
138693
|
-
await
|
|
138694
|
-
|
|
138695
|
-
});
|
|
138696
|
-
console.error(`\u274C [Init] Failed iterate codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`, error);
|
|
138774
|
+
await (0, codegen_flow_helpers_1.updateParentTaskStatus)(localJobContext, CodeGenService_1.TaskStatus.FAILED, error);
|
|
138775
|
+
console.error(`\u274C [Iterate] Failed iterate codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`, error);
|
|
138697
138776
|
}
|
|
138698
138777
|
};
|
|
138699
138778
|
exports2.runIterateCodegenFlow = runIterateCodegenFlow;
|
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.62",
|
|
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": "73032240b41bf383a302f704545d08c7acbfdf0936a82b5aaa9c0c3b"
|
|
28
28
|
}
|