@wix/ditto-codegen-public 1.0.107 → 1.0.108

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 CHANGED
@@ -76977,6 +76977,7 @@ var require_enums2 = __commonJS({
76977
76977
  ExtensionGenerationOperation2["INSERT"] = "insert";
76978
76978
  ExtensionGenerationOperation2["UPDATE"] = "update";
76979
76979
  ExtensionGenerationOperation2["DELETE"] = "delete";
76980
+ ExtensionGenerationOperation2["EDIT"] = "edit";
76980
76981
  })(ExtensionGenerationOperation || (exports2.ExtensionGenerationOperation = ExtensionGenerationOperation = {}));
76981
76982
  var ErrorOrigin;
76982
76983
  (function(ErrorOrigin2) {
@@ -91,6 +91,7 @@ var require_enums = __commonJS({
91
91
  ExtensionGenerationOperation7["INSERT"] = "insert";
92
92
  ExtensionGenerationOperation7["UPDATE"] = "update";
93
93
  ExtensionGenerationOperation7["DELETE"] = "delete";
94
+ ExtensionGenerationOperation7["EDIT"] = "edit";
94
95
  })(ExtensionGenerationOperation6 || (exports2.ExtensionGenerationOperation = ExtensionGenerationOperation6 = {}));
95
96
  var ErrorOrigin4;
96
97
  (function(ErrorOrigin5) {
@@ -292,7 +293,7 @@ var require_FileSystemError = __commonJS({
292
293
  exports2.FileSystemError = void 0;
293
294
  var BaseCodegenError_1 = require_BaseCodegenError();
294
295
  var ErrorTypes_1 = require_ErrorTypes();
295
- var FileSystemError2 = class extends BaseCodegenError_1.BaseCodegenError {
296
+ var FileSystemError3 = class extends BaseCodegenError_1.BaseCodegenError {
296
297
  constructor(message, options) {
297
298
  super(message);
298
299
  this.name = "FileSystemError";
@@ -314,7 +315,7 @@ var require_FileSystemError = __commonJS({
314
315
  return props;
315
316
  }
316
317
  };
317
- exports2.FileSystemError = FileSystemError2;
318
+ exports2.FileSystemError = FileSystemError3;
318
319
  }
319
320
  });
320
321
 
@@ -59148,15 +59149,37 @@ ${hasEmbeddedScriptExtensions ? embeddedScriptDynamicParametersPrompt() : 'No em
59148
59149
  var import_fs = __toESM(require("fs"));
59149
59150
  var import_path2 = __toESM(require("path"));
59150
59151
  var import_ditto_codegen_types3 = __toESM(require_dist());
59151
- var FileItemSchema = external_exports.object({
59152
- operation: external_exports.enum(import_ditto_codegen_types3.ExtensionGenerationOperation).describe(
59153
- "File operation: insert (new file), update (modify existing), delete (remove file)"
59154
- ).default(import_ditto_codegen_types3.ExtensionGenerationOperation.INSERT),
59155
- path: external_exports.string().describe("Relative file path from project root").optional(),
59156
- content: external_exports.string().describe(
59157
- "Complete file content as a string (for JSON files, stringify the object). Required for insert and update operations."
59158
- ).optional()
59159
- });
59152
+ var FileItemSchema = external_exports.discriminatedUnion("operation", [
59153
+ external_exports.object({
59154
+ operation: external_exports.union([
59155
+ external_exports.literal(import_ditto_codegen_types3.ExtensionGenerationOperation.INSERT),
59156
+ external_exports.literal(import_ditto_codegen_types3.ExtensionGenerationOperation.UPDATE),
59157
+ external_exports.literal(import_ditto_codegen_types3.ExtensionGenerationOperation.DELETE)
59158
+ ]).describe(
59159
+ "File operation: insert (new file), update (modify existing), delete (remove file)"
59160
+ ).default(import_ditto_codegen_types3.ExtensionGenerationOperation.INSERT),
59161
+ path: external_exports.string().describe("Relative file path from project root").optional(),
59162
+ content: external_exports.string().describe(
59163
+ "Complete file content as a string (for JSON files, stringify the object). Required for insert and update operations."
59164
+ ).optional()
59165
+ }),
59166
+ external_exports.object({
59167
+ operation: external_exports.literal(import_ditto_codegen_types3.ExtensionGenerationOperation.EDIT),
59168
+ path: external_exports.string().describe("Relative file path from project root"),
59169
+ replacements: external_exports.array(
59170
+ external_exports.object({
59171
+ oldString: external_exports.string().describe(
59172
+ "The text to replace (must match the file contents exactly, including all whitespace and indentation)"
59173
+ ),
59174
+ newString: external_exports.string().describe("The edited text to replace the oldString"),
59175
+ replaceAll: external_exports.boolean().optional().describe("Replace all occurrences of oldString (default false)")
59176
+ })
59177
+ ).min(1).describe("List of string replacements to apply")
59178
+ })
59179
+ ]).describe(`Representation of an operation that modifies a file on the local file system.
59180
+ Use the 'insert' operation to create a new file.
59181
+ Use the 'delete' operation to remove a file.
59182
+ To modify a file, you can either use the 'edit' operation to replace a specific strings with new strings (THIS IS THE PREFERRED WAY TO MODIFY A FILE), or use the 'update' operation to replace the entire file with new content.`);
59160
59183
  var FilesSchema = external_exports.object({
59161
59184
  files: external_exports.array(FileItemSchema).default([]).describe("An array of files")
59162
59185
  });
@@ -63854,10 +63877,6 @@ var DittoEventEmitter = class extends import_events.EventEmitter {
63854
63877
  // src/extensions/extensionProcessors.ts
63855
63878
  var import_types11 = __toESM(require_types_impl());
63856
63879
 
63857
- // src/extensions/extensionHelpers.ts
63858
- var import_path9 = __toESM(require("path"));
63859
- var import_fs6 = __toESM(require("fs"));
63860
-
63861
63880
  // src/extensions/extensionGenerators.ts
63862
63881
  var import_path7 = __toESM(require("path"));
63863
63882
  var import_fs_extra = __toESM(require_lib());
@@ -64266,9 +64285,137 @@ function collectAllCreatedFiles(options) {
64266
64285
  return uniqueFiles;
64267
64286
  }
64268
64287
 
64269
- // src/extensions/extensionHelpers.ts
64270
- var import_ditto_scaffolding4 = __toESM(require_dist5());
64288
+ // src/extensions/write-file.ts
64271
64289
  var import_ditto_codegen_types16 = __toESM(require_dist());
64290
+ var import_fs6 = __toESM(require("fs"));
64291
+ var import_path9 = __toESM(require("path"));
64292
+
64293
+ // src/truncate.ts
64294
+ function truncate(str, maxLength = 50) {
64295
+ if (str.length <= maxLength) {
64296
+ return str;
64297
+ }
64298
+ return str.substring(0, maxLength) + "...";
64299
+ }
64300
+
64301
+ // src/extensions/write-file.ts
64302
+ var handleInsert = (file2, fullPath) => {
64303
+ if (!("content" in file2) || !file2.content) {
64304
+ console.warn(
64305
+ `\u26A0\uFE0F Skipping insert operation for ${file2.path}: no content provided`
64306
+ );
64307
+ return;
64308
+ }
64309
+ const dir = import_path9.default.dirname(fullPath);
64310
+ if (!import_fs6.default.existsSync(dir)) {
64311
+ import_fs6.default.mkdirSync(dir, { recursive: true });
64312
+ }
64313
+ writeFileInFileSystem(fullPath, file2.content.trim());
64314
+ console.log(`\u{1F4DD} Inserted: ${file2.path}`);
64315
+ };
64316
+ var handleUpdate = (file2, fullPath) => {
64317
+ if (!("content" in file2) || !file2.content) {
64318
+ console.warn(
64319
+ `\u26A0\uFE0F Skipping update operation for ${file2.path}: no content provided`
64320
+ );
64321
+ return;
64322
+ }
64323
+ if (!import_fs6.default.existsSync(fullPath)) {
64324
+ console.warn(
64325
+ `\u26A0\uFE0F Skipping update operation for ${file2.path}: file does not exist`
64326
+ );
64327
+ return;
64328
+ }
64329
+ writeFileInFileSystem(fullPath, file2.content.trim());
64330
+ console.log(`\u{1F4DD} Updated: ${file2.path}`);
64331
+ };
64332
+ var handleDelete = (file2, fullPath) => {
64333
+ if (import_fs6.default.existsSync(fullPath)) {
64334
+ try {
64335
+ import_fs6.default.unlinkSync(fullPath);
64336
+ console.log(`\u{1F5D1}\uFE0F Deleted: ${file2.path}`);
64337
+ } catch (error46) {
64338
+ throw new import_ditto_codegen_types16.FileSystemError(`Failed to delete file: ${file2.path}`, {
64339
+ filePath: fullPath,
64340
+ operation: import_ditto_codegen_types16.FileSystemOperation.DELETE,
64341
+ cause: error46
64342
+ });
64343
+ }
64344
+ } else {
64345
+ console.warn(
64346
+ `\u26A0\uFE0F Skipping delete operation for ${file2.path}: file does not exist`
64347
+ );
64348
+ }
64349
+ };
64350
+ var handleEdit = (file2, fullPath) => {
64351
+ if (!("replacements" in file2) || !file2.replacements || file2.replacements.length === 0) {
64352
+ console.warn(
64353
+ `\u26A0\uFE0F Skipping edit operation for ${file2.path}: no replacements provided`
64354
+ );
64355
+ return;
64356
+ }
64357
+ if (!import_fs6.default.existsSync(fullPath)) {
64358
+ console.warn(
64359
+ `\u26A0\uFE0F Skipping edit operation for ${file2.path}: file does not exist`
64360
+ );
64361
+ return;
64362
+ }
64363
+ let content = import_fs6.default.readFileSync(fullPath, "utf8");
64364
+ for (const replacement of file2.replacements) {
64365
+ if (!content.includes(replacement.oldString)) {
64366
+ console.warn(
64367
+ `\u26A0\uFE0F Replacement pattern not found in ${file2.path}: "${truncate(replacement.oldString)}"`
64368
+ );
64369
+ continue;
64370
+ }
64371
+ content = replacement.replaceAll ? content.replaceAll(replacement.oldString, replacement.newString) : content.replace(replacement.oldString, replacement.newString);
64372
+ }
64373
+ writeFileInFileSystem(fullPath, content);
64374
+ console.log(`\u270F\uFE0F Edited: ${file2.path}`);
64375
+ };
64376
+ var operationHandlers = {
64377
+ [import_ditto_codegen_types16.ExtensionGenerationOperation.INSERT]: handleInsert,
64378
+ [import_ditto_codegen_types16.ExtensionGenerationOperation.UPDATE]: handleUpdate,
64379
+ [import_ditto_codegen_types16.ExtensionGenerationOperation.DELETE]: handleDelete,
64380
+ [import_ditto_codegen_types16.ExtensionGenerationOperation.EDIT]: handleEdit
64381
+ };
64382
+ function writeFile(files, outputPath) {
64383
+ if (!files) {
64384
+ console.warn("\u26A0\uFE0F Skipping file operation: no files provided");
64385
+ return;
64386
+ }
64387
+ for (const file2 of files) {
64388
+ if (!file2.path) {
64389
+ console.warn("\u26A0\uFE0F Skipping file operation: no path specified");
64390
+ continue;
64391
+ }
64392
+ const fullPath = import_path9.default.join(outputPath, file2.path);
64393
+ const handler = operationHandlers[file2.operation];
64394
+ if (!handler) {
64395
+ throw new import_ditto_codegen_types16.ExtensionGenerationError(
64396
+ `Unknown operation "${file2.operation}" for file ${file2.path || "unknown"}`,
64397
+ {
64398
+ operation: file2.operation,
64399
+ filePath: file2.path || "unknown"
64400
+ }
64401
+ );
64402
+ }
64403
+ handler(file2, fullPath);
64404
+ }
64405
+ }
64406
+ function writeFileInFileSystem(filePath, content) {
64407
+ try {
64408
+ import_fs6.default.writeFileSync(filePath, content);
64409
+ } catch (error46) {
64410
+ throw new import_ditto_codegen_types16.FileSystemError(`Failed to write file: ${filePath}`, {
64411
+ filePath,
64412
+ operation: import_ditto_codegen_types16.FileSystemOperation.WRITE,
64413
+ cause: error46
64414
+ });
64415
+ }
64416
+ }
64417
+
64418
+ // src/extensions/finalize-extension-generation.ts
64272
64419
  function finalizeExtensionGeneration(options, eventEmitter) {
64273
64420
  const {
64274
64421
  extension,
@@ -64306,101 +64453,16 @@ function finalizeExtensionGeneration(options, eventEmitter) {
64306
64453
  throw createExtensionErrorHandler(eventEmitter, extension)(error46);
64307
64454
  }
64308
64455
  }
64309
- function writeFile(files, outputPath) {
64310
- if (!files) {
64311
- console.warn("\u26A0\uFE0F Skipping file operation: no files provided");
64312
- return;
64313
- }
64314
- for (const file2 of files) {
64315
- if (!file2.path) {
64316
- console.warn("\u26A0\uFE0F Skipping file operation: no path specified");
64317
- continue;
64318
- }
64319
- const fullPath = import_path9.default.join(outputPath, file2.path);
64320
- switch (file2.operation) {
64321
- case import_ditto_codegen_types16.ExtensionGenerationOperation.INSERT: {
64322
- if (!file2.content) {
64323
- console.warn(
64324
- `\u26A0\uFE0F Skipping insert operation for ${file2.path}: no content provided`
64325
- );
64326
- continue;
64327
- }
64328
- try {
64329
- const dir = import_path9.default.dirname(fullPath);
64330
- if (!import_fs6.default.existsSync(dir)) {
64331
- import_fs6.default.mkdirSync(dir, { recursive: true });
64332
- }
64333
- import_fs6.default.writeFileSync(fullPath, file2.content.trim());
64334
- console.log(`\u{1F4DD} Inserted: ${file2.path}`);
64335
- } catch (error46) {
64336
- throw new import_ditto_codegen_types16.FileSystemError(`Failed to write file: ${file2.path}`, {
64337
- filePath: fullPath,
64338
- operation: import_ditto_codegen_types16.FileSystemOperation.WRITE,
64339
- cause: error46
64340
- });
64341
- }
64342
- break;
64343
- }
64344
- case import_ditto_codegen_types16.ExtensionGenerationOperation.UPDATE:
64345
- if (!file2.content) {
64346
- console.warn(
64347
- `\u26A0\uFE0F Skipping update operation for ${file2.path}: no content provided`
64348
- );
64349
- continue;
64350
- }
64351
- if (!import_fs6.default.existsSync(fullPath)) {
64352
- console.warn(
64353
- `\u26A0\uFE0F Skipping update operation for ${file2.path}: file does not exist`
64354
- );
64355
- continue;
64356
- }
64357
- try {
64358
- import_fs6.default.writeFileSync(fullPath, file2.content.trim());
64359
- console.log(`\u{1F4DD} Updated: ${file2.path}`);
64360
- } catch (error46) {
64361
- throw new import_ditto_codegen_types16.FileSystemError(`Failed to update file: ${file2.path}`, {
64362
- filePath: fullPath,
64363
- operation: import_ditto_codegen_types16.FileSystemOperation.WRITE,
64364
- cause: error46
64365
- });
64366
- }
64367
- break;
64368
- case import_ditto_codegen_types16.ExtensionGenerationOperation.DELETE:
64369
- if (import_fs6.default.existsSync(fullPath)) {
64370
- try {
64371
- import_fs6.default.unlinkSync(fullPath);
64372
- console.log(`\u{1F5D1}\uFE0F Deleted: ${file2.path}`);
64373
- } catch (error46) {
64374
- throw new import_ditto_codegen_types16.FileSystemError(`Failed to delete file: ${file2.path}`, {
64375
- filePath: fullPath,
64376
- operation: import_ditto_codegen_types16.FileSystemOperation.DELETE,
64377
- cause: error46
64378
- });
64379
- }
64380
- } else {
64381
- console.warn(
64382
- `\u26A0\uFE0F Skipping delete operation for ${file2.path}: file does not exist`
64383
- );
64384
- }
64385
- break;
64386
- default: {
64387
- throw new import_ditto_codegen_types16.ExtensionGenerationError(
64388
- `Unknown operation "${file2.operation}" for file ${file2.path}`,
64389
- {
64390
- operation: file2.operation,
64391
- filePath: file2.path
64392
- }
64393
- );
64394
- }
64395
- }
64396
- }
64397
- }
64456
+
64457
+ // src/extensions/create-scaffolding.ts
64458
+ var import_ditto_codegen_types17 = __toESM(require_dist());
64459
+ var import_ditto_scaffolding4 = __toESM(require_dist5());
64398
64460
  async function createScaffolding(extension, outputPath, eventEmitter) {
64399
64461
  eventEmitter.emitEvent("scaffold:start", { extension });
64400
64462
  try {
64401
64463
  const scaffolds = await (0, import_ditto_scaffolding4.copyScaffoldingTemplate)(extension, outputPath);
64402
64464
  if (!scaffolds || scaffolds.length === 0) {
64403
- throw new import_ditto_codegen_types16.ScaffoldingError(`Failed to scaffold ${extension.type}`, {
64465
+ throw new import_ditto_codegen_types17.ScaffoldingError(`Failed to scaffold ${extension.type}`, {
64404
64466
  extensionType: extension.type
64405
64467
  });
64406
64468
  }
@@ -64410,10 +64472,10 @@ async function createScaffolding(extension, outputPath, eventEmitter) {
64410
64472
  });
64411
64473
  return scaffolds;
64412
64474
  } catch (error46) {
64413
- if (error46 instanceof import_ditto_codegen_types16.FileSystemError || error46 instanceof import_ditto_codegen_types16.ScaffoldingError) {
64475
+ if (error46 instanceof import_ditto_codegen_types17.FileSystemError || error46 instanceof import_ditto_codegen_types17.ScaffoldingError) {
64414
64476
  throw error46;
64415
64477
  }
64416
- throw (0, import_ditto_codegen_types16.toCodegenError)(error46);
64478
+ throw (0, import_ditto_codegen_types17.toCodegenError)(error46);
64417
64479
  }
64418
64480
  }
64419
64481
 
@@ -64506,7 +64568,7 @@ async function processExistingExtension(params) {
64506
64568
  }
64507
64569
 
64508
64570
  // src/extensions/dashboardPage.ts
64509
- var import_ditto_codegen_types17 = __toESM(require_dist());
64571
+ var import_ditto_codegen_types18 = __toESM(require_dist());
64510
64572
  async function processDashboardPage(params) {
64511
64573
  const {
64512
64574
  extension,
@@ -64544,10 +64606,10 @@ async function processDashboardPage(params) {
64544
64606
  console.log("\u{1F3AF} Using auto-patterns for dashboard generation");
64545
64607
  const relevantCollection = plan?.collections?.map((op) => op.data).find((c) => c.idSuffix === decision.relevantCollectionId);
64546
64608
  if (!relevantCollection) {
64547
- throw new import_ditto_codegen_types17.ResourceNotFoundError(
64609
+ throw new import_ditto_codegen_types18.ResourceNotFoundError(
64548
64610
  `Collection with ID ${decision.relevantCollectionId} not found in created collections`,
64549
64611
  {
64550
- resourceType: import_ditto_codegen_types17.ResourceType.COLLECTION,
64612
+ resourceType: import_ditto_codegen_types18.ResourceType.COLLECTION,
64551
64613
  resourceId: decision.relevantCollectionId
64552
64614
  }
64553
64615
  );
@@ -64579,7 +64641,7 @@ async function processDashboardPage(params) {
64579
64641
 
64580
64642
  // src/extensions/servicePlugin.ts
64581
64643
  var import_types12 = __toESM(require_types_impl());
64582
- var import_ditto_codegen_types18 = __toESM(require_dist());
64644
+ var import_ditto_codegen_types19 = __toESM(require_dist());
64583
64645
  async function processMultipleServicePluginScaffolds(params) {
64584
64646
  const {
64585
64647
  extension,
@@ -64592,18 +64654,18 @@ async function processMultipleServicePluginScaffolds(params) {
64592
64654
  userRequestSummary
64593
64655
  } = params;
64594
64656
  if (!extension.relatedSpis || extension.relatedSpis.length === 0) {
64595
- throw new import_ditto_codegen_types18.UnsupportedExtensionTypeError(
64657
+ throw new import_ditto_codegen_types19.UnsupportedExtensionTypeError(
64596
64658
  "Service plugin extension must have related SPIs",
64597
64659
  {
64598
64660
  extensionType: extension.type || import_types12.ExtensionType.SERVICE_PLUGIN,
64599
- origin: import_ditto_codegen_types18.ErrorOrigin.INITIAL
64661
+ origin: import_ditto_codegen_types19.ErrorOrigin.INITIAL
64600
64662
  }
64601
64663
  );
64602
64664
  }
64603
64665
  const parallelTasks = extension.relatedSpis.map(async (spi, i) => {
64604
64666
  const scaffold = scaffolds[i];
64605
64667
  if (!scaffold) {
64606
- throw new import_ditto_codegen_types18.ScaffoldingError("No scaffold generated for extension", {
64668
+ throw new import_ditto_codegen_types19.ScaffoldingError("No scaffold generated for extension", {
64607
64669
  extensionType: extension.type
64608
64670
  });
64609
64671
  }
@@ -64733,7 +64795,7 @@ async function processEmbeddedScriptExtension(params) {
64733
64795
  // src/cms/index.ts
64734
64796
  var import_path10 = __toESM(require("path"));
64735
64797
  var import_crypto2 = require("crypto");
64736
- var import_ditto_codegen_types19 = __toESM(require_dist());
64798
+ var import_ditto_codegen_types20 = __toESM(require_dist());
64737
64799
  var getDataExtensionAndCollectionsFiles = ({
64738
64800
  plan
64739
64801
  }) => {
@@ -64767,7 +64829,7 @@ export const dataExtension = extensions.genericExtension(${JSON.stringify(
64767
64829
  )});
64768
64830
  `;
64769
64831
  files.push({
64770
- operation: import_ditto_codegen_types19.ExtensionGenerationOperation.INSERT,
64832
+ operation: import_ditto_codegen_types20.ExtensionGenerationOperation.INSERT,
64771
64833
  path: import_path10.default.join("src", "data", "extensions.ts"),
64772
64834
  content: generatedCode
64773
64835
  });
@@ -64905,11 +64967,11 @@ var DittoOrchestrator = class extends DittoEventEmitter {
64905
64967
  };
64906
64968
 
64907
64969
  // src/flows/init-codegen.ts
64908
- var import_ditto_codegen_types21 = __toESM(require_dist());
64970
+ var import_ditto_codegen_types22 = __toESM(require_dist());
64909
64971
 
64910
64972
  // src/flows/codegen-flow-helpers.ts
64911
64973
  var import_path11 = __toESM(require("path"));
64912
- var import_ditto_codegen_types20 = __toESM(require_dist());
64974
+ var import_ditto_codegen_types21 = __toESM(require_dist());
64913
64975
  var import_http = __toESM(require_http_impl());
64914
64976
  var import_http_client = __toESM(require_index_node());
64915
64977
  var slugify = (str = "") => {
@@ -64925,7 +64987,7 @@ function setupAgentTaskTracking(eventEmitter, jobContext) {
64925
64987
  codeGenerationService.addTask(jobContext.jobId, {
64926
64988
  id: taskId,
64927
64989
  kind: "run_agent",
64928
- status: import_ditto_codegen_types20.Status.RUNNING,
64990
+ status: import_ditto_codegen_types21.Status.RUNNING,
64929
64991
  name: "run_agent",
64930
64992
  description: `Run agent for ${extension.name}`,
64931
64993
  payload: { extension }
@@ -64937,7 +64999,7 @@ function setupAgentTaskTracking(eventEmitter, jobContext) {
64937
64999
  codeGenerationService.updateTask(
64938
65000
  jobContext.jobId,
64939
65001
  taskId,
64940
- import_ditto_codegen_types20.Status.COMPLETED,
65002
+ import_ditto_codegen_types21.Status.COMPLETED,
64941
65003
  { taskOutput: { files } }
64942
65004
  );
64943
65005
  });
@@ -64947,7 +65009,7 @@ function setupAgentTaskTracking(eventEmitter, jobContext) {
64947
65009
  await codeGenerationService.updateTask(
64948
65010
  jobContext.jobId,
64949
65011
  taskId,
64950
- import_ditto_codegen_types20.Status.FAILED,
65012
+ import_ditto_codegen_types21.Status.FAILED,
64951
65013
  {
64952
65014
  error: serializeError(error46)
64953
65015
  }
@@ -64999,7 +65061,7 @@ function getRelatedApis(extensions) {
64999
65061
  }
65000
65062
 
65001
65063
  // src/flows/init-codegen.ts
65002
- var import_ditto_codegen_types22 = __toESM(require_dist());
65064
+ var import_ditto_codegen_types23 = __toESM(require_dist());
65003
65065
  var runInitCodegenFlow = async (blueprint) => {
65004
65066
  const localJobContext = jobContextStorage.getStore();
65005
65067
  console.log(
@@ -65008,7 +65070,7 @@ var runInitCodegenFlow = async (blueprint) => {
65008
65070
  await codeGenerationService.updateTask(
65009
65071
  localJobContext.jobId,
65010
65072
  localJobContext.taskId,
65011
- import_ditto_codegen_types21.Status.RUNNING,
65073
+ import_ditto_codegen_types22.Status.RUNNING,
65012
65074
  {}
65013
65075
  );
65014
65076
  console.log(
@@ -65028,7 +65090,7 @@ var runInitCodegenFlow = async (blueprint) => {
65028
65090
  requiredPermissions: requiredPermissionsResponse?.data?.requiredPermissions ?? []
65029
65091
  });
65030
65092
  } catch (error46) {
65031
- const codegenError = (0, import_ditto_codegen_types22.toCodegenError)(error46);
65093
+ const codegenError = (0, import_ditto_codegen_types23.toCodegenError)(error46);
65032
65094
  console.error(
65033
65095
  `\u274C [Init] Failed to get required permissions: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`,
65034
65096
  error46
@@ -65045,13 +65107,13 @@ var runInitCodegenFlow = async (blueprint) => {
65045
65107
  accessToken: ctx.accessToken,
65046
65108
  appNamespace: ctx.appNamespace
65047
65109
  });
65048
- await updateParentTaskStatus(localJobContext, import_ditto_codegen_types21.Status.COMPLETED);
65110
+ await updateParentTaskStatus(localJobContext, import_ditto_codegen_types22.Status.COMPLETED);
65049
65111
  console.log(
65050
65112
  `[Init] Completed init codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`
65051
65113
  );
65052
65114
  } catch (error46) {
65053
- const codegenError = (0, import_ditto_codegen_types22.toCodegenError)(error46);
65054
- await updateParentTaskStatus(localJobContext, import_ditto_codegen_types21.Status.FAILED, codegenError);
65115
+ const codegenError = (0, import_ditto_codegen_types23.toCodegenError)(error46);
65116
+ await updateParentTaskStatus(localJobContext, import_ditto_codegen_types22.Status.FAILED, codegenError);
65055
65117
  console.error(
65056
65118
  `\u274C [Init] Failed init codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`,
65057
65119
  error46
@@ -65060,7 +65122,7 @@ var runInitCodegenFlow = async (blueprint) => {
65060
65122
  };
65061
65123
 
65062
65124
  // src/flows/iterate-codegen.ts
65063
- var import_ditto_codegen_types23 = __toESM(require_dist());
65125
+ var import_ditto_codegen_types24 = __toESM(require_dist());
65064
65126
 
65065
65127
  // src/IterationOrchestrator.ts
65066
65128
  var import_path12 = __toESM(require("path"));
@@ -65294,7 +65356,7 @@ var IterationOrchestrator = class extends DittoEventEmitter {
65294
65356
  };
65295
65357
 
65296
65358
  // src/flows/iterate-codegen.ts
65297
- var import_ditto_codegen_types24 = __toESM(require_dist());
65359
+ var import_ditto_codegen_types25 = __toESM(require_dist());
65298
65360
  var runIterateCodegenFlow = async (chatHistory) => {
65299
65361
  const localJobContext = jobContextStorage.getStore();
65300
65362
  console.log(
@@ -65303,7 +65365,7 @@ var runIterateCodegenFlow = async (chatHistory) => {
65303
65365
  await codeGenerationService.updateTask(
65304
65366
  localJobContext.jobId,
65305
65367
  localJobContext.taskId,
65306
- import_ditto_codegen_types23.Status.RUNNING,
65368
+ import_ditto_codegen_types24.Status.RUNNING,
65307
65369
  {}
65308
65370
  );
65309
65371
  console.log(
@@ -65330,13 +65392,13 @@ var runIterateCodegenFlow = async (chatHistory) => {
65330
65392
  appNamespace: ctx.appNamespace,
65331
65393
  iterationPlan
65332
65394
  });
65333
- await updateParentTaskStatus(localJobContext, import_ditto_codegen_types23.Status.COMPLETED);
65395
+ await updateParentTaskStatus(localJobContext, import_ditto_codegen_types24.Status.COMPLETED);
65334
65396
  console.log(
65335
65397
  `[Init] Completed iterate codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`
65336
65398
  );
65337
65399
  } catch (error46) {
65338
- const codegenError = (0, import_ditto_codegen_types24.toCodegenError)(error46);
65339
- await updateParentTaskStatus(localJobContext, import_ditto_codegen_types23.Status.FAILED, codegenError);
65400
+ const codegenError = (0, import_ditto_codegen_types25.toCodegenError)(error46);
65401
+ await updateParentTaskStatus(localJobContext, import_ditto_codegen_types24.Status.FAILED, codegenError);
65340
65402
  console.error(
65341
65403
  `\u274C [Iterate] Failed iterate codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`,
65342
65404
  error46
@@ -65357,7 +65419,7 @@ async function updateRequiredPermissions(iterationPlan, localJobContext) {
65357
65419
  requiredPermissions: requiredPermissionsResponse?.data?.requiredPermissions ?? []
65358
65420
  });
65359
65421
  } catch (error46) {
65360
- const codegenError = (0, import_ditto_codegen_types24.toCodegenError)(error46);
65422
+ const codegenError = (0, import_ditto_codegen_types25.toCodegenError)(error46);
65361
65423
  console.error(
65362
65424
  `\u274C [Iterate] Failed to get required permissions: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`,
65363
65425
  error46
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.107",
3
+ "version": "1.0.108",
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": "8ee39d55939afdd14344a74a7a4f50e452e76710f780631012bf636b"
27
+ "falconPackageHash": "d308a26ac94d9e52b29937f76e7837685cfd0ba752c295ffc1e14a9d"
28
28
  }