@wix/ditto-codegen-public 1.0.262 → 1.0.264

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.
Files changed (2) hide show
  1. package/dist/out.js +350 -7
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -141,7 +141,7 @@ var require_main = __commonJS({
141
141
  var fs4 = require("fs");
142
142
  var path4 = require("path");
143
143
  var os = require("os");
144
- var crypto5 = require("crypto");
144
+ var crypto6 = require("crypto");
145
145
  var packageJson = require_package();
146
146
  var version3 = packageJson.version;
147
147
  var TIPS = [
@@ -392,7 +392,7 @@ var require_main = __commonJS({
392
392
  const authTag = ciphertext.subarray(-16);
393
393
  ciphertext = ciphertext.subarray(12, -16);
394
394
  try {
395
- const aesgcm = crypto5.createDecipheriv("aes-256-gcm", key, nonce);
395
+ const aesgcm = crypto6.createDecipheriv("aes-256-gcm", key, nonce);
396
396
  aesgcm.setAuthTag(authTag);
397
397
  return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
398
398
  } catch (error48) {
@@ -6514,9 +6514,12 @@ var require_http_impl = __commonJS({
6514
6514
  exports2.updateTask = updateTask;
6515
6515
  exports2.stopGeneration = stopGeneration;
6516
6516
  exports2.submitUserDecision = submitUserDecision;
6517
+ exports2.cleanupStaleJobs = cleanupStaleJobs;
6517
6518
  var metro_runtime_1 = require_build();
6518
6519
  var ambassador_1 = require_ambassador_index();
6519
6520
  var metro_runtime_2 = require_build();
6521
+ var _cleanupStaleJobsRequest = {};
6522
+ var _cleanupStaleJobsResponse = {};
6520
6523
  var _createJobRequest = { job: "_job" };
6521
6524
  var _createJobResponse = { job: "_job" };
6522
6525
  var _createTaskRequest = { task: "_task" };
@@ -6593,6 +6596,24 @@ var require_http_impl = __commonJS({
6593
6596
  srcPath: "/_api/codegen-server",
6594
6597
  destPath: ""
6595
6598
  }
6599
+ ],
6600
+ "editor._base_domain_": [
6601
+ {
6602
+ srcPath: "/_api/codegen-server",
6603
+ destPath: ""
6604
+ }
6605
+ ],
6606
+ "blocks._base_domain_": [
6607
+ {
6608
+ srcPath: "/_api/codegen-server",
6609
+ destPath: ""
6610
+ }
6611
+ ],
6612
+ "create.editorx": [
6613
+ {
6614
+ srcPath: "/_api/codegen-server",
6615
+ destPath: ""
6616
+ }
6596
6617
  ]
6597
6618
  };
6598
6619
  return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -6898,6 +6919,33 @@ var require_http_impl = __commonJS({
6898
6919
  __submitUserDecision.__isAmbassador = true;
6899
6920
  return __submitUserDecision;
6900
6921
  }
6922
+ function cleanupStaleJobs(payload) {
6923
+ var _a2 = (0, ambassador_1.serializer)(_cleanupStaleJobsRequest, {}), toReq = _a2.toJSON, fromReq = _a2.fromJSON;
6924
+ var fromRes = (0, ambassador_1.serializer)(_cleanupStaleJobsResponse, {}).fromJSON;
6925
+ function __cleanupStaleJobs(_a3) {
6926
+ var host = _a3.host;
6927
+ var serializedData = toReq(payload);
6928
+ var metadata = {
6929
+ entityFqdn: "wix.ctp.codegen_job_service.v1.job",
6930
+ method: "POST",
6931
+ methodFqn: "com.wixpress.ditto.codegen_job_service.api.CodegenJobService.CleanupStaleJobs",
6932
+ migrationOptions: {
6933
+ optInTransformResponse: true
6934
+ },
6935
+ url: resolveComWixpressDittoCodegenJobServiceApiCodegenJobServiceUrl({
6936
+ protoPath: "/v1/cleanup-stale-jobs",
6937
+ data: serializedData,
6938
+ host
6939
+ }),
6940
+ data: serializedData,
6941
+ transformResponse: fromRes
6942
+ };
6943
+ return metadata;
6944
+ }
6945
+ __cleanupStaleJobs.fromReq = fromReq;
6946
+ __cleanupStaleJobs.__isAmbassador = true;
6947
+ return __cleanupStaleJobs;
6948
+ }
6901
6949
  }
6902
6950
  });
6903
6951
 
@@ -10302,6 +10350,34 @@ var require_CodeGenService = __commonJS({
10302
10350
  }
10303
10351
  }));
10304
10352
  };
10353
+ this.updateJobWithPendingDecision = async (jobId, userDecision) => {
10354
+ logger_12.logger.info("Setting job to await user decision", {
10355
+ jobId,
10356
+ decisionId: userDecision.id,
10357
+ userDecision: JSON.stringify(userDecision, null, 2)
10358
+ });
10359
+ await this.httpClient.request((0, http_1.updateJob)({
10360
+ projectId: this.projectId,
10361
+ job: {
10362
+ id: jobId,
10363
+ projectId: this.projectId,
10364
+ status: types_1.Status.AWAITING_USER_INPUT,
10365
+ pendingUserDecisions: [userDecision]
10366
+ }
10367
+ }));
10368
+ };
10369
+ this.resumeJobFromDecision = async (jobId) => {
10370
+ logger_12.logger.info("Resuming job from user decision", { jobId });
10371
+ await this.httpClient.request((0, http_1.updateJob)({
10372
+ projectId: this.projectId,
10373
+ job: {
10374
+ id: jobId,
10375
+ projectId: this.projectId,
10376
+ status: types_1.Status.RUNNING,
10377
+ pendingUserDecisions: []
10378
+ }
10379
+ }));
10380
+ };
10305
10381
  this.updateTask = async (jobId, taskId, status, payload) => {
10306
10382
  await this.httpClient.request((0, http_1.updateTask)({
10307
10383
  projectId: this.projectId,
@@ -11144,6 +11220,14 @@ var require_generation = __commonJS({
11144
11220
  }
11145
11221
  });
11146
11222
 
11223
+ // ../codegen-types/dist/types/user-decision.js
11224
+ var require_user_decision = __commonJS({
11225
+ "../codegen-types/dist/types/user-decision.js"(exports2) {
11226
+ "use strict";
11227
+ Object.defineProperty(exports2, "__esModule", { value: true });
11228
+ }
11229
+ });
11230
+
11147
11231
  // ../codegen-types/dist/ai/index.js
11148
11232
  var require_ai = __commonJS({
11149
11233
  "../codegen-types/dist/ai/index.js"(exports2) {
@@ -11186,6 +11270,7 @@ var require_dist4 = __commonJS({
11186
11270
  __exportStar2(require_status(), exports2);
11187
11271
  __exportStar2(require_task(), exports2);
11188
11272
  __exportStar2(require_generation(), exports2);
11273
+ __exportStar2(require_user_decision(), exports2);
11189
11274
  __exportStar2(require_ai(), exports2);
11190
11275
  }
11191
11276
  });
@@ -74085,6 +74170,7 @@ var require_SPIAgent = __commonJS({
74085
74170
  - "ecom.taxCalculationProvider.calculateTax" - For custom tax calculations
74086
74171
  - "ecom.recommendationsProvider.getRecommendations" - For product recommendations
74087
74172
  - "ecom.catalog.getCatalogItems" - For external catalog integration
74173
+ - "bookings.staffSortingProvider.sortStaffMembers" - For custom staff sorting/assignment in bookings
74088
74174
 
74089
74175
  **SPI Selection Guidelines:**
74090
74176
  - For shipping-related requests \u2192 use "ecom.shippingRates.getShippingRates"
@@ -74096,6 +74182,7 @@ var require_SPIAgent = __commonJS({
74096
74182
  - For tax calculations \u2192 use "ecom.taxCalculationProvider.calculateTax"
74097
74183
  - For product recommendations \u2192 use "ecom.recommendationsProvider.getRecommendations"
74098
74184
  - For external catalog \u2192 use "ecom.catalog.getCatalogItems"
74185
+ - For staff sorting/assignment in bookings \u2192 use "bookings.staffSortingProvider.sortStaffMembers"
74099
74186
  </service_plugin>`;
74100
74187
  };
74101
74188
  exports2.getSPIAgentDocumentation = getSPIAgentDocumentation;
@@ -94831,6 +94918,229 @@ var require_codegen_flow_helpers = __commonJS({
94831
94918
  }
94832
94919
  });
94833
94920
 
94921
+ // dist/job-decision-manager.js
94922
+ var require_job_decision_manager = __commonJS({
94923
+ "dist/job-decision-manager.js"(exports2) {
94924
+ "use strict";
94925
+ Object.defineProperty(exports2, "__esModule", { value: true });
94926
+ exports2.UserDecisionCancelledError = void 0;
94927
+ exports2.pauseForUserDecision = pauseForUserDecision;
94928
+ exports2.askJobChoice = askJobChoice;
94929
+ exports2.askJobConfirmation = askJobConfirmation;
94930
+ var types_1 = require_types_impl();
94931
+ var codeGenerationService_12 = require_codeGenerationService();
94932
+ var CodeGenService_12 = require_CodeGenService();
94933
+ var logger_12 = require_logger();
94934
+ var DECISION_POLL_INTERVAL_MS = 2e3;
94935
+ var UserDecisionCancelledError = class extends Error {
94936
+ constructor(jobId, decisionId) {
94937
+ super(`User decision ${decisionId} cancelled for job ${jobId}`);
94938
+ this.jobId = jobId;
94939
+ this.decisionId = decisionId;
94940
+ this.name = "UserDecisionCancelledError";
94941
+ }
94942
+ };
94943
+ exports2.UserDecisionCancelledError = UserDecisionCancelledError;
94944
+ async function pauseForUserDecision(jobId, request) {
94945
+ const decisionId = crypto.randomUUID();
94946
+ const userDecision = {
94947
+ id: decisionId,
94948
+ request: {
94949
+ ...request,
94950
+ requestedAt: /* @__PURE__ */ new Date()
94951
+ }
94952
+ };
94953
+ await codeGenerationService_12.codeGenerationService.updateJobWithPendingDecision(jobId, userDecision);
94954
+ logger_12.logger.info(`[JobDecision] Job ${jobId} paused for user input`, {
94955
+ question: request.question
94956
+ });
94957
+ const response = await pollForJobDecisionResponse(jobId, decisionId);
94958
+ await codeGenerationService_12.codeGenerationService.resumeJobFromDecision(jobId);
94959
+ logger_12.logger.info(`[JobDecision] Job ${jobId} resumed`, {
94960
+ selectedOptionId: response.selectedOptionId
94961
+ });
94962
+ return response;
94963
+ }
94964
+ async function pollForJobDecisionResponse(jobId, decisionId) {
94965
+ while (true) {
94966
+ const job = await codeGenerationService_12.codeGenerationService.getJob(jobId);
94967
+ if (!job) {
94968
+ throw new Error(`Job ${jobId} not found`);
94969
+ }
94970
+ logger_12.logger.info(`[JobDecision] Polling for job ${jobId} decision ${decisionId}`, { job: JSON.stringify(job, null, 2) });
94971
+ if (job.status === CodeGenService_12.Status.CANCELLED || job.status === CodeGenService_12.Status.PENDING_CANCEL) {
94972
+ throw new UserDecisionCancelledError(jobId, decisionId);
94973
+ }
94974
+ const decision = job.pendingUserDecisions?.find((d) => d.id === decisionId) ?? job.userDecisionHistory?.find((d) => d.id === decisionId);
94975
+ if (decision?.response?.selectedOptionId) {
94976
+ return {
94977
+ selectedOptionId: decision.response.selectedOptionId,
94978
+ respondedAt: decision.response.respondedAt ?? /* @__PURE__ */ new Date()
94979
+ };
94980
+ }
94981
+ await new Promise((resolve3) => setTimeout(resolve3, DECISION_POLL_INTERVAL_MS));
94982
+ }
94983
+ }
94984
+ async function askJobChoice(jobId, question, options, context2) {
94985
+ const response = await pauseForUserDecision(jobId, {
94986
+ question,
94987
+ questionType: types_1.UserDecisionQuestionType.UI_COMPONENT_TYPE,
94988
+ options,
94989
+ context: context2
94990
+ });
94991
+ if (!response.selectedOptionId) {
94992
+ throw new Error("No option selected in user decision response");
94993
+ }
94994
+ return response.selectedOptionId;
94995
+ }
94996
+ async function askJobConfirmation(jobId, question, context2) {
94997
+ const response = await pauseForUserDecision(jobId, {
94998
+ question,
94999
+ questionType: types_1.UserDecisionQuestionType.UI_COMPONENT_TYPE,
95000
+ options: [
95001
+ { id: "yes", label: "Yes" },
95002
+ { id: "no", label: "No" }
95003
+ ],
95004
+ context: context2
95005
+ });
95006
+ return response.selectedOptionId === "yes";
95007
+ }
95008
+ }
95009
+ });
95010
+
95011
+ // dist/pre-run-decision.js
95012
+ var require_pre_run_decision = __commonJS({
95013
+ "dist/pre-run-decision.js"(exports2) {
95014
+ "use strict";
95015
+ Object.defineProperty(exports2, "__esModule", { value: true });
95016
+ exports2.runPreDecisionCheck = runPreDecisionCheck;
95017
+ exports2.checkSiteUIDecision = checkSiteUIDecision;
95018
+ var types_1 = require_types_impl2();
95019
+ var job_decision_manager_1 = require_job_decision_manager();
95020
+ var logger_12 = require_logger();
95021
+ async function runPreDecisionCheck(jobId, context2, checkers) {
95022
+ const allDecisions = [];
95023
+ let modifiedBlueprint = context2.blueprint;
95024
+ let modifiedIterationPlan = context2.iterationPlan;
95025
+ for (const checker of checkers) {
95026
+ const result = await checker(jobId, {
95027
+ blueprint: modifiedBlueprint,
95028
+ iterationPlan: modifiedIterationPlan
95029
+ });
95030
+ if (result) {
95031
+ allDecisions.push(...result.decisionsApplied);
95032
+ if (result.modifiedBlueprint) {
95033
+ modifiedBlueprint = result.modifiedBlueprint;
95034
+ }
95035
+ if (result.modifiedIterationPlan) {
95036
+ modifiedIterationPlan = result.modifiedIterationPlan;
95037
+ }
95038
+ }
95039
+ }
95040
+ return {
95041
+ decisionsApplied: allDecisions,
95042
+ modifiedBlueprint,
95043
+ modifiedIterationPlan
95044
+ };
95045
+ }
95046
+ async function checkSiteUIDecision(jobId, context2) {
95047
+ const extensions = getExtensions(context2);
95048
+ const siteUIExtension = extensions.find((ext) => isSiteUIExtension(ext));
95049
+ if (!siteUIExtension?.name) {
95050
+ return null;
95051
+ }
95052
+ const extensionName = siteUIExtension.name;
95053
+ const currentType = siteUIExtension.type;
95054
+ logger_12.logger.info(`[PreDecision] Found site UI extension: "${extensionName}" (current type: ${currentType})`);
95055
+ const selectedType = await (0, job_decision_manager_1.askJobChoice)(jobId, `What type of site UI element would you like to create for "${extensionName}"?`, [
95056
+ {
95057
+ id: types_1.ExtensionType.SITE_WIDGET,
95058
+ label: "Site Widget (Custom Element)",
95059
+ description: "A self-contained widget built as a Custom Element, embedded on the site. Best for standalone, reusable components."
95060
+ },
95061
+ {
95062
+ id: types_1.ExtensionType.SITE_COMPONENT,
95063
+ label: "Site Component (React)",
95064
+ description: "A React component that integrates with the site builder. Best for components that need to work with Wix editor features."
95065
+ }
95066
+ ], "Site Widgets are standalone embeddable units with their own styling, while Site Components integrate more deeply with the Wix editor and builder.");
95067
+ const isTypeChanged = selectedType !== currentType;
95068
+ logger_12.logger.info(`[PreDecision] User selected ${selectedType} for "${extensionName}"${isTypeChanged ? ` (changed from ${currentType})` : " (unchanged)"}`);
95069
+ const appliedDecision = {
95070
+ type: "SITE_UI_TYPE",
95071
+ question: "Site Widget vs Site Component",
95072
+ selectedOptionId: selectedType
95073
+ };
95074
+ return {
95075
+ decisionsApplied: [appliedDecision],
95076
+ modifiedBlueprint: context2.blueprint ? applyTypeToBlueprint(context2.blueprint, extensionName, selectedType) : void 0,
95077
+ modifiedIterationPlan: context2.iterationPlan ? applyTypeToIterationPlan(context2.iterationPlan, extensionName, selectedType) : void 0
95078
+ };
95079
+ }
95080
+ function getExtensions(context2) {
95081
+ if (context2.blueprint) {
95082
+ return context2.blueprint.extensions ?? [];
95083
+ }
95084
+ if (context2.iterationPlan) {
95085
+ return context2.iterationPlan.additionalExtensions?.map((e) => e.extension) ?? [];
95086
+ }
95087
+ return [];
95088
+ }
95089
+ function isSiteUIExtension(extension) {
95090
+ return extension.type === types_1.ExtensionType.SITE_WIDGET || extension.type === types_1.ExtensionType.SITE_COMPONENT;
95091
+ }
95092
+ function applyTypeToBlueprint(blueprint, extensionName, type) {
95093
+ return {
95094
+ ...blueprint,
95095
+ extensions: blueprint.extensions?.map((ext) => ext.name === extensionName ? { ...ext, type } : ext)
95096
+ };
95097
+ }
95098
+ function applyTypeToIterationPlan(plan, extensionName, type) {
95099
+ return {
95100
+ ...plan,
95101
+ additionalExtensions: plan.additionalExtensions?.map((item) => item.extension.name === extensionName ? { ...item, extension: { ...item.extension, type } } : item)
95102
+ };
95103
+ }
95104
+ }
95105
+ });
95106
+
95107
+ // dist/experiments.js
95108
+ var require_experiments = __commonJS({
95109
+ "dist/experiments.js"(exports2) {
95110
+ "use strict";
95111
+ Object.defineProperty(exports2, "__esModule", { value: true });
95112
+ exports2.isExperimentEnabled = isExperimentEnabled;
95113
+ exports2.isUserDecisionsEnabled = isUserDecisionsEnabled;
95114
+ var logger_12 = require_logger();
95115
+ var parsedExperiments = null;
95116
+ function getExperiments() {
95117
+ if (parsedExperiments !== null) {
95118
+ return parsedExperiments;
95119
+ }
95120
+ const raw = process.env.CODEGEN_EXPERIMENTS;
95121
+ if (!raw) {
95122
+ parsedExperiments = {};
95123
+ return parsedExperiments;
95124
+ }
95125
+ try {
95126
+ parsedExperiments = JSON.parse(raw);
95127
+ } catch (error48) {
95128
+ logger_12.logger.error("[Experiments] Failed to parse CODEGEN_EXPERIMENTS", {
95129
+ error: error48 instanceof Error ? error48.message : String(error48)
95130
+ });
95131
+ parsedExperiments = {};
95132
+ }
95133
+ return parsedExperiments;
95134
+ }
95135
+ function isExperimentEnabled(specName) {
95136
+ return getExperiments()[specName] === "true";
95137
+ }
95138
+ function isUserDecisionsEnabled() {
95139
+ return isExperimentEnabled("specs.ditto.CodegenUserDecisions");
95140
+ }
95141
+ }
95142
+ });
95143
+
94834
95144
  // dist/flows/opencode-init.js
94835
95145
  var require_opencode_init = __commonJS({
94836
95146
  "dist/flows/opencode-init.js"(exports2) {
@@ -94846,6 +95156,8 @@ var require_opencode_init = __commonJS({
94846
95156
  var ditto_codegen_types_2 = require_dist4();
94847
95157
  var context_12 = require_context();
94848
95158
  var logger_12 = require_logger();
95159
+ var pre_run_decision_1 = require_pre_run_decision();
95160
+ var experiments_1 = require_experiments();
94849
95161
  var runOpencodeInitFlow = async (blueprint, history) => {
94850
95162
  const store = job_context_storage_12.jobContextStorage.getStore();
94851
95163
  if (!store?.jobId || !store?.taskId) {
@@ -94861,10 +95173,18 @@ var require_opencode_init = __commonJS({
94861
95173
  jobLog.info(`[OpenCode Init] Marked task RUNNING: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
94862
95174
  try {
94863
95175
  const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
95176
+ let finalBlueprint = blueprint;
95177
+ if ((0, experiments_1.isUserDecisionsEnabled)()) {
95178
+ const preDecisionResult = await (0, pre_run_decision_1.runPreDecisionCheck)(localJobContext.jobId, { blueprint }, [pre_run_decision_1.checkSiteUIDecision]);
95179
+ finalBlueprint = preDecisionResult.modifiedBlueprint ?? blueprint;
95180
+ if (preDecisionResult.decisionsApplied.length > 0) {
95181
+ jobLog.info(`[OpenCode Init] Applied ${preDecisionResult.decisionsApplied.length} pre-decision(s)`);
95182
+ }
95183
+ }
94864
95184
  const orchestrator = new OpenCodeOrchestrator_1.OpenCodeOrchestrator();
94865
95185
  (0, cli_listeners_1.attachOrchestratorListeners)(orchestrator);
94866
95186
  const result = await orchestrator.generateCode({
94867
- blueprint,
95187
+ blueprint: finalBlueprint,
94868
95188
  outputPath,
94869
95189
  projectId: context_12.ctx.projectId,
94870
95190
  chatHistory: history
@@ -128542,7 +128862,9 @@ var require_init_codegen = __commonJS({
128542
128862
  var ditto_codegen_types_12 = require_dist4();
128543
128863
  var codegen_flow_helpers_12 = require_codegen_flow_helpers();
128544
128864
  var ditto_codegen_types_2 = require_dist4();
128865
+ var pre_run_decision_1 = require_pre_run_decision();
128545
128866
  var logger_12 = require_logger();
128867
+ var experiments_1 = require_experiments();
128546
128868
  var runInitCodegenFlow = async (blueprint, history) => {
128547
128869
  const localJobContext = job_context_storage_12.jobContextStorage.getStore();
128548
128870
  const jobLog = (0, logger_12.getJobLogger)(localJobContext.jobId, localJobContext.taskId);
@@ -128551,11 +128873,19 @@ var require_init_codegen = __commonJS({
128551
128873
  jobLog.info(`[Init] Marked task RUNNING: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
128552
128874
  try {
128553
128875
  const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
128876
+ let finalBlueprint = blueprint;
128877
+ if ((0, experiments_1.isUserDecisionsEnabled)()) {
128878
+ const preDecisionResult = await (0, pre_run_decision_1.runPreDecisionCheck)(localJobContext.jobId, { blueprint }, [pre_run_decision_1.checkSiteUIDecision]);
128879
+ finalBlueprint = preDecisionResult.modifiedBlueprint ?? blueprint;
128880
+ if (preDecisionResult.decisionsApplied.length > 0) {
128881
+ jobLog.info(`[Init] Applied ${preDecisionResult.decisionsApplied.length} pre-decision(s)`);
128882
+ }
128883
+ }
128554
128884
  const agentsFactory = new AgentsFactory_1.AgentsFactory(false);
128555
128885
  const orchestrator = new orchestrator_1.DittoOrchestrator(agentsFactory);
128556
128886
  (0, cli_listeners_1.attachOrchestratorListeners)(orchestrator);
128557
128887
  try {
128558
- const requiredPermissionsResponse = await (0, codegen_flow_helpers_12.getRequiredPermissions)(blueprint?.extensions ?? []);
128888
+ const requiredPermissionsResponse = await (0, codegen_flow_helpers_12.getRequiredPermissions)(finalBlueprint?.extensions ?? []);
128559
128889
  await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
128560
128890
  requiredPermissions: requiredPermissionsResponse?.data?.requiredPermissions ?? [],
128561
128891
  history
@@ -128570,7 +128900,7 @@ var require_init_codegen = __commonJS({
128570
128900
  });
128571
128901
  }
128572
128902
  await orchestrator.generateCode({
128573
- blueprint,
128903
+ blueprint: finalBlueprint,
128574
128904
  outputPath,
128575
128905
  appNamespace: context_12.ctx.appNamespace,
128576
128906
  history
@@ -342617,7 +342947,9 @@ var require_iterate_codegen = __commonJS({
342617
342947
  var IterationOrchestrator_1 = require_IterationOrchestrator();
342618
342948
  var codegen_flow_helpers_12 = require_codegen_flow_helpers();
342619
342949
  var ditto_codegen_types_2 = require_dist4();
342950
+ var pre_run_decision_1 = require_pre_run_decision();
342620
342951
  var logger_12 = require_logger();
342952
+ var experiments_1 = require_experiments();
342621
342953
  var runIterateCodegenFlow = async (chatHistory) => {
342622
342954
  const localJobContext = job_context_storage_12.jobContextStorage.getStore();
342623
342955
  const jobLog = (0, logger_12.getJobLogger)(localJobContext.jobId, localJobContext.taskId);
@@ -342633,11 +342965,22 @@ var require_iterate_codegen = __commonJS({
342633
342965
  outputPath,
342634
342966
  chatHistory
342635
342967
  });
342636
- await updateRequiredPermissions(iterationPlan, localJobContext);
342968
+ let finalIterationPlan = iterationPlan;
342969
+ if ((0, experiments_1.isUserDecisionsEnabled)()) {
342970
+ const preDecisionResult = await (0, pre_run_decision_1.runPreDecisionCheck)(localJobContext.jobId, { iterationPlan }, [pre_run_decision_1.checkSiteUIDecision]);
342971
+ finalIterationPlan = preDecisionResult.modifiedIterationPlan ?? iterationPlan;
342972
+ if (preDecisionResult.decisionsApplied.length > 0) {
342973
+ jobLog.info(`[Iterate] Applied ${preDecisionResult.decisionsApplied.length} pre-decision(s)`);
342974
+ }
342975
+ }
342976
+ await updateRequiredPermissions(finalIterationPlan, localJobContext);
342637
342977
  await iterationOrchestrator.generateIterationCode({
342638
342978
  outputPath,
342639
342979
  appNamespace: context_12.ctx.appNamespace,
342640
- iterationPlanAndPreviousResources: { iterationPlan, previousResources }
342980
+ iterationPlanAndPreviousResources: {
342981
+ iterationPlan: finalIterationPlan,
342982
+ previousResources
342983
+ }
342641
342984
  });
342642
342985
  await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.COMPLETED);
342643
342986
  jobLog.info(`[Iterate] Completed iterate codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.262",
3
+ "version": "1.0.264",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -28,5 +28,5 @@
28
28
  "@wix/ditto-codegen": "1.0.0",
29
29
  "esbuild": "^0.27.2"
30
30
  },
31
- "falconPackageHash": "b88fabba9f75546e458e019c050fd35d0350190b1f2025841cc30957"
31
+ "falconPackageHash": "d5b33c5294fc11ed339d4e199e2dbae4d8a1b3385cd663d92bf62440"
32
32
  }