@wix/ditto-codegen-public 1.0.340 → 1.0.342

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 +271 -211
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -10938,6 +10938,22 @@ var require_user_decision = __commonJS({
10938
10938
  }
10939
10939
  });
10940
10940
 
10941
+ // ../codegen-types/dist/types/environment.js
10942
+ var require_environment = __commonJS({
10943
+ "../codegen-types/dist/types/environment.js"(exports2) {
10944
+ "use strict";
10945
+ Object.defineProperty(exports2, "__esModule", { value: true });
10946
+ }
10947
+ });
10948
+
10949
+ // ../codegen-types/dist/types/hooks.js
10950
+ var require_hooks = __commonJS({
10951
+ "../codegen-types/dist/types/hooks.js"(exports2) {
10952
+ "use strict";
10953
+ Object.defineProperty(exports2, "__esModule", { value: true });
10954
+ }
10955
+ });
10956
+
10941
10957
  // ../codegen-types/dist/types/job-payload.js
10942
10958
  var require_job_payload = __commonJS({
10943
10959
  "../codegen-types/dist/types/job-payload.js"(exports2) {
@@ -10946,6 +10962,14 @@ var require_job_payload = __commonJS({
10946
10962
  }
10947
10963
  });
10948
10964
 
10965
+ // ../codegen-types/dist/types/logger.js
10966
+ var require_logger2 = __commonJS({
10967
+ "../codegen-types/dist/types/logger.js"(exports2) {
10968
+ "use strict";
10969
+ Object.defineProperty(exports2, "__esModule", { value: true });
10970
+ }
10971
+ });
10972
+
10949
10973
  // ../codegen-types/dist/ai/index.js
10950
10974
  var require_ai = __commonJS({
10951
10975
  "../codegen-types/dist/ai/index.js"(exports2) {
@@ -10989,7 +11013,10 @@ var require_dist4 = __commonJS({
10989
11013
  __exportStar2(require_task(), exports2);
10990
11014
  __exportStar2(require_generation(), exports2);
10991
11015
  __exportStar2(require_user_decision(), exports2);
11016
+ __exportStar2(require_environment(), exports2);
11017
+ __exportStar2(require_hooks(), exports2);
10992
11018
  __exportStar2(require_job_payload(), exports2);
11019
+ __exportStar2(require_logger2(), exports2);
10993
11020
  __exportStar2(require_ai(), exports2);
10994
11021
  }
10995
11022
  });
@@ -11355,6 +11382,160 @@ var require_rules_writer = __commonJS({
11355
11382
  }
11356
11383
  });
11357
11384
 
11385
+ // ../../node_modules/@wix/ambassador-ctp-ditto-v1-blueprint/cjs/build/types.impl.js
11386
+ var require_types_impl2 = __commonJS({
11387
+ "../../node_modules/@wix/ambassador-ctp-ditto-v1-blueprint/cjs/build/types.impl.js"(exports2) {
11388
+ "use strict";
11389
+ Object.defineProperty(exports2, "__esModule", { value: true });
11390
+ exports2.ExtensionType = void 0;
11391
+ var ExtensionType;
11392
+ (function(ExtensionType2) {
11393
+ ExtensionType2["UNDEFINED_EXTENSION_TYPE"] = "UNDEFINED_EXTENSION_TYPE";
11394
+ ExtensionType2["DASHBOARD_PAGE"] = "DASHBOARD_PAGE";
11395
+ ExtensionType2["DASHBOARD_PLUGIN"] = "DASHBOARD_PLUGIN";
11396
+ ExtensionType2["DASHBOARD_MODAL"] = "DASHBOARD_MODAL";
11397
+ ExtensionType2["SITE_WIDGET"] = "SITE_WIDGET";
11398
+ ExtensionType2["EMBEDDED_SCRIPT"] = "EMBEDDED_SCRIPT";
11399
+ ExtensionType2["BACKEND_API"] = "BACKEND_API";
11400
+ ExtensionType2["BACKEND_EVENT"] = "BACKEND_EVENT";
11401
+ ExtensionType2["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
11402
+ ExtensionType2["WEB_METHODS"] = "WEB_METHODS";
11403
+ ExtensionType2["SITE_COMPONENT"] = "SITE_COMPONENT";
11404
+ ExtensionType2["WEBHOOK"] = "WEBHOOK";
11405
+ ExtensionType2["SITE_PLUGIN"] = "SITE_PLUGIN";
11406
+ ExtensionType2["DATA_COLLECTION"] = "DATA_COLLECTION";
11407
+ ExtensionType2["DASHBOARD_MENU_PLUGIN"] = "DASHBOARD_MENU_PLUGIN";
11408
+ ExtensionType2["CUSTOM_ELEMENT_WIDGET"] = "CUSTOM_ELEMENT_WIDGET";
11409
+ ExtensionType2["EDITOR_REACT_COMPONENT"] = "EDITOR_REACT_COMPONENT";
11410
+ })(ExtensionType || (exports2.ExtensionType = ExtensionType = {}));
11411
+ }
11412
+ });
11413
+
11414
+ // ../codegen-app-builder-config/dist/check-site-ui-decision.js
11415
+ var require_check_site_ui_decision = __commonJS({
11416
+ "../codegen-app-builder-config/dist/check-site-ui-decision.js"(exports2) {
11417
+ "use strict";
11418
+ Object.defineProperty(exports2, "__esModule", { value: true });
11419
+ exports2.createCheckSiteUIDecision = void 0;
11420
+ var types_1 = require_types_impl2();
11421
+ var createCheckSiteUIDecision = (deps) => {
11422
+ const { askChoice, logger } = deps;
11423
+ return async (jobId, context) => {
11424
+ const blueprint = context.payload;
11425
+ const extensions = blueprint?.extensions ?? [];
11426
+ const siteUIExtension = extensions.find((ext) => isSiteUIExtension(ext));
11427
+ if (!siteUIExtension?.name)
11428
+ return null;
11429
+ const extensionName = siteUIExtension.name;
11430
+ const currentType = siteUIExtension.type;
11431
+ logger?.info(`[PreDecision] Found site UI extension: "${extensionName}" (current type: ${currentType})`);
11432
+ const options = [
11433
+ {
11434
+ id: types_1.ExtensionType.CUSTOM_ELEMENT_WIDGET,
11435
+ label: "Custom Element Widget",
11436
+ description: "A self-contained widget built as a Custom Element, embedded on the site. Best for standalone, reusable components."
11437
+ },
11438
+ {
11439
+ id: types_1.ExtensionType.EDITOR_REACT_COMPONENT,
11440
+ label: "Editor React Component",
11441
+ description: "A React component that integrates with the site builder. Best for components that need to work with Wix editor features."
11442
+ }
11443
+ ];
11444
+ const selectedType = await askChoice(jobId, `What type of site UI element would you like to create for "${extensionName}"?`, options, "Custom Element Widgets are standalone embeddable units with their own styling, while Editor React Components integrate more deeply with the Wix editor and builder.");
11445
+ const selectedLabel = options.find((o) => o.id === selectedType)?.label ?? selectedType;
11446
+ const isTypeChanged = selectedType !== currentType;
11447
+ logger?.info(`[PreDecision] User selected ${selectedType} for "${extensionName}"${isTypeChanged ? ` (changed from ${currentType})` : " (unchanged)"}`);
11448
+ const appliedDecision = {
11449
+ type: "SITE_UI_TYPE",
11450
+ question: "Custom Element Widget vs Editor React Component",
11451
+ selectedOptionId: selectedType
11452
+ };
11453
+ return {
11454
+ decisionsApplied: [appliedDecision],
11455
+ modifiedPayload: blueprint ? applyTypeToBlueprint(blueprint, extensionName, selectedType, selectedLabel) : void 0
11456
+ };
11457
+ };
11458
+ };
11459
+ exports2.createCheckSiteUIDecision = createCheckSiteUIDecision;
11460
+ function isSiteUIExtension(extension) {
11461
+ return extension.type === types_1.ExtensionType.CUSTOM_ELEMENT_WIDGET || extension.type === types_1.ExtensionType.EDITOR_REACT_COMPONENT;
11462
+ }
11463
+ function applyTypeToBlueprint(blueprint, extensionName, type, label) {
11464
+ const summaryNotice = `[USER DECISION] The user explicitly chose "${label}" for the "${extensionName}" extension. You MUST generate it as type ${type}. Do NOT use any other type.`;
11465
+ const descriptionNotice = `[USER DECISION] This extension MUST be a ${label} (type: ${type}). The user explicitly chose this. Do NOT change it.`;
11466
+ return {
11467
+ ...blueprint,
11468
+ summary: `${summaryNotice}
11469
+
11470
+ ${blueprint.summary ?? ""}`.trim(),
11471
+ extensions: blueprint.extensions?.map((ext) => ext.name === extensionName ? {
11472
+ ...ext,
11473
+ type,
11474
+ description: `${descriptionNotice}
11475
+
11476
+ ${ext.description ?? ""}`.trim(),
11477
+ _userDecision: "IMPORTANT: The user explicitly chose this extension type. You MUST use this exact type."
11478
+ } : ext)
11479
+ };
11480
+ }
11481
+ }
11482
+ });
11483
+
11484
+ // ../codegen-app-builder-config/dist/index.js
11485
+ var require_dist5 = __commonJS({
11486
+ "../codegen-app-builder-config/dist/index.js"(exports2) {
11487
+ "use strict";
11488
+ Object.defineProperty(exports2, "__esModule", { value: true });
11489
+ exports2.appBuilderCodegenConfig = exports2.createCheckSiteUIDecision = void 0;
11490
+ var check_site_ui_decision_1 = require_check_site_ui_decision();
11491
+ Object.defineProperty(exports2, "createCheckSiteUIDecision", { enumerable: true, get: function() {
11492
+ return check_site_ui_decision_1.createCheckSiteUIDecision;
11493
+ } });
11494
+ exports2.appBuilderCodegenConfig = {
11495
+ codegenRules: [],
11496
+ askRules: [],
11497
+ decisionCheckers: [],
11498
+ hooks: []
11499
+ };
11500
+ }
11501
+ });
11502
+
11503
+ // ../codegen-studio-2-config/dist/site-data-layer-rules.js
11504
+ var require_site_data_layer_rules = __commonJS({
11505
+ "../codegen-studio-2-config/dist/site-data-layer-rules.js"(exports2) {
11506
+ "use strict";
11507
+ Object.defineProperty(exports2, "__esModule", { value: true });
11508
+ exports2.SITE_DATA_LAYER_RULES = void 0;
11509
+ exports2.SITE_DATA_LAYER_RULES = `# Site Data Layer Rules
11510
+
11511
+ The agent operates on a live Wix site (METASITE_ID is in your prompt context).
11512
+
11513
+ For any persistent-data need \u2014 CMS collections, content tables, schemas, data models, or databases that store items \u2014 use the \`wix-site-data-collection\` skill.
11514
+
11515
+ The \`wix-app\` skill remains the right tool for surrounding extensions (dashboard pages, modals, widgets); only the data layer is overridden. A Wix CLI data collection extension will NOT work here \u2014 it only provisions on app install, but this is a live site that already exists. Use the \`wix-site-data-collection\` skill to discover the existing collections on the site and wire your code against them.
11516
+
11517
+ DO NOT write any code relating to Wix CLI data extensions \u2014 for example, do not generate \`src/extensions/data/extensions.ts\`.`;
11518
+ }
11519
+ });
11520
+
11521
+ // ../codegen-studio-2-config/dist/index.js
11522
+ var require_dist6 = __commonJS({
11523
+ "../codegen-studio-2-config/dist/index.js"(exports2) {
11524
+ "use strict";
11525
+ Object.defineProperty(exports2, "__esModule", { value: true });
11526
+ exports2.studio2CodegenConfig = void 0;
11527
+ var site_data_layer_rules_1 = require_site_data_layer_rules();
11528
+ exports2.studio2CodegenConfig = {
11529
+ codegenRules: [
11530
+ { filename: "site-data-layer-rules.md", content: site_data_layer_rules_1.SITE_DATA_LAYER_RULES }
11531
+ ],
11532
+ askRules: [],
11533
+ decisionCheckers: [],
11534
+ hooks: []
11535
+ };
11536
+ }
11537
+ });
11538
+
11358
11539
  // dist/opencode-integration/rules/codegen-rules.js
11359
11540
  var require_codegen_rules = __commonJS({
11360
11541
  "dist/opencode-integration/rules/codegen-rules.js"(exports2) {
@@ -11461,35 +11642,6 @@ IMPORTANT INSTRUCTIONS:
11461
11642
  }
11462
11643
  });
11463
11644
 
11464
- // ../../node_modules/@wix/ambassador-ctp-ditto-v1-blueprint/cjs/build/types.impl.js
11465
- var require_types_impl2 = __commonJS({
11466
- "../../node_modules/@wix/ambassador-ctp-ditto-v1-blueprint/cjs/build/types.impl.js"(exports2) {
11467
- "use strict";
11468
- Object.defineProperty(exports2, "__esModule", { value: true });
11469
- exports2.ExtensionType = void 0;
11470
- var ExtensionType;
11471
- (function(ExtensionType2) {
11472
- ExtensionType2["UNDEFINED_EXTENSION_TYPE"] = "UNDEFINED_EXTENSION_TYPE";
11473
- ExtensionType2["DASHBOARD_PAGE"] = "DASHBOARD_PAGE";
11474
- ExtensionType2["DASHBOARD_PLUGIN"] = "DASHBOARD_PLUGIN";
11475
- ExtensionType2["DASHBOARD_MODAL"] = "DASHBOARD_MODAL";
11476
- ExtensionType2["SITE_WIDGET"] = "SITE_WIDGET";
11477
- ExtensionType2["EMBEDDED_SCRIPT"] = "EMBEDDED_SCRIPT";
11478
- ExtensionType2["BACKEND_API"] = "BACKEND_API";
11479
- ExtensionType2["BACKEND_EVENT"] = "BACKEND_EVENT";
11480
- ExtensionType2["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
11481
- ExtensionType2["WEB_METHODS"] = "WEB_METHODS";
11482
- ExtensionType2["SITE_COMPONENT"] = "SITE_COMPONENT";
11483
- ExtensionType2["WEBHOOK"] = "WEBHOOK";
11484
- ExtensionType2["SITE_PLUGIN"] = "SITE_PLUGIN";
11485
- ExtensionType2["DATA_COLLECTION"] = "DATA_COLLECTION";
11486
- ExtensionType2["DASHBOARD_MENU_PLUGIN"] = "DASHBOARD_MENU_PLUGIN";
11487
- ExtensionType2["CUSTOM_ELEMENT_WIDGET"] = "CUSTOM_ELEMENT_WIDGET";
11488
- ExtensionType2["EDITOR_REACT_COMPONENT"] = "EDITOR_REACT_COMPONENT";
11489
- })(ExtensionType || (exports2.ExtensionType = ExtensionType = {}));
11490
- }
11491
- });
11492
-
11493
11645
  // dist/job-decision-manager.js
11494
11646
  var require_job_decision_manager = __commonJS({
11495
11647
  "dist/job-decision-manager.js"(exports2) {
@@ -11586,147 +11738,6 @@ var require_job_decision_manager = __commonJS({
11586
11738
  }
11587
11739
  });
11588
11740
 
11589
- // dist/pre-run-decision.js
11590
- var require_pre_run_decision = __commonJS({
11591
- "dist/pre-run-decision.js"(exports2) {
11592
- "use strict";
11593
- Object.defineProperty(exports2, "__esModule", { value: true });
11594
- exports2.checkSiteUIDecision = void 0;
11595
- exports2.runPreDecisionCheck = runPreDecisionCheck;
11596
- var types_1 = require_types_impl2();
11597
- var job_decision_manager_1 = require_job_decision_manager();
11598
- var logger_12 = require_logger();
11599
- async function runPreDecisionCheck(jobId, context, checkers) {
11600
- const allDecisions = [];
11601
- let modifiedPayload = context.payload;
11602
- for (const checker of checkers) {
11603
- const result = await checker(jobId, {
11604
- payload: modifiedPayload
11605
- });
11606
- if (result) {
11607
- allDecisions.push(...result.decisionsApplied);
11608
- if (result.modifiedPayload) {
11609
- modifiedPayload = result.modifiedPayload;
11610
- }
11611
- }
11612
- }
11613
- return {
11614
- decisionsApplied: allDecisions,
11615
- modifiedPayload
11616
- };
11617
- }
11618
- var checkSiteUIDecision = async (jobId, context) => {
11619
- const blueprint = context.payload;
11620
- const extensions = blueprint?.extensions ?? [];
11621
- const siteUIExtension = extensions.find((ext) => isSiteUIExtension(ext));
11622
- if (!siteUIExtension?.name) {
11623
- return null;
11624
- }
11625
- const extensionName = siteUIExtension.name;
11626
- const currentType = siteUIExtension.type;
11627
- logger_12.logger.info(`[PreDecision] Found site UI extension: "${extensionName}" (current type: ${currentType})`);
11628
- const { widget: widgetType, component: componentType } = getSiteUITypePair(currentType);
11629
- const options = [
11630
- {
11631
- id: widgetType,
11632
- label: "Custom Element Widget",
11633
- description: "A self-contained widget built as a Custom Element, embedded on the site. Best for standalone, reusable components."
11634
- },
11635
- {
11636
- id: componentType,
11637
- label: "Editor React Component",
11638
- description: "A React component that integrates with the site builder. Best for components that need to work with Wix editor features."
11639
- }
11640
- ];
11641
- const selectedType = await (0, job_decision_manager_1.askJobChoice)(jobId, `What type of site UI element would you like to create for "${extensionName}"?`, options, "Custom Element Widgets are standalone embeddable units with their own styling, while Editor React Components integrate more deeply with the Wix editor and builder.");
11642
- const selectedLabel = options.find((o) => o.id === selectedType)?.label ?? selectedType;
11643
- const isTypeChanged = selectedType !== currentType;
11644
- logger_12.logger.info(`[PreDecision] User selected ${selectedType} for "${extensionName}"${isTypeChanged ? ` (changed from ${currentType})` : " (unchanged)"}`);
11645
- const appliedDecision = {
11646
- type: "SITE_UI_TYPE",
11647
- question: "Custom Element Widget vs Editor React Component",
11648
- selectedOptionId: selectedType
11649
- };
11650
- return {
11651
- decisionsApplied: [appliedDecision],
11652
- modifiedPayload: blueprint ? applyTypeToBlueprint(blueprint, extensionName, selectedType, selectedLabel) : void 0
11653
- };
11654
- };
11655
- exports2.checkSiteUIDecision = checkSiteUIDecision;
11656
- function isSiteUIExtension(extension) {
11657
- return extension.type === types_1.ExtensionType.SITE_WIDGET || extension.type === types_1.ExtensionType.SITE_COMPONENT || extension.type === types_1.ExtensionType.CUSTOM_ELEMENT_WIDGET || extension.type === types_1.ExtensionType.EDITOR_REACT_COMPONENT;
11658
- }
11659
- function isLegacySiteUIType(type) {
11660
- return type === types_1.ExtensionType.SITE_WIDGET || type === types_1.ExtensionType.SITE_COMPONENT;
11661
- }
11662
- function getSiteUITypePair(type) {
11663
- return isLegacySiteUIType(type) ? {
11664
- widget: types_1.ExtensionType.SITE_WIDGET,
11665
- component: types_1.ExtensionType.SITE_COMPONENT
11666
- } : {
11667
- widget: types_1.ExtensionType.CUSTOM_ELEMENT_WIDGET,
11668
- component: types_1.ExtensionType.EDITOR_REACT_COMPONENT
11669
- };
11670
- }
11671
- function applyTypeToBlueprint(blueprint, extensionName, type, label) {
11672
- const summaryNotice = `[USER DECISION] The user explicitly chose "${label}" for the "${extensionName}" extension. You MUST generate it as type ${type}. Do NOT use any other type.`;
11673
- const descriptionNotice = `[USER DECISION] This extension MUST be a ${label} (type: ${type}). The user explicitly chose this. Do NOT change it.`;
11674
- return {
11675
- ...blueprint,
11676
- summary: `${summaryNotice}
11677
-
11678
- ${blueprint.summary ?? ""}`.trim(),
11679
- extensions: blueprint.extensions?.map((ext) => ext.name === extensionName ? {
11680
- ...ext,
11681
- type,
11682
- description: `${descriptionNotice}
11683
-
11684
- ${ext.description ?? ""}`.trim(),
11685
- _userDecision: "IMPORTANT: The user explicitly chose this extension type. You MUST use this exact type."
11686
- } : ext)
11687
- };
11688
- }
11689
- }
11690
- });
11691
-
11692
- // dist/environments/app-builder.js
11693
- var require_app_builder = __commonJS({
11694
- "dist/environments/app-builder.js"(exports2) {
11695
- "use strict";
11696
- Object.defineProperty(exports2, "__esModule", { value: true });
11697
- exports2.appBuilderCodegenConfig = void 0;
11698
- var codegen_rules_1 = require_codegen_rules();
11699
- var ask_rules_1 = require_ask_rules();
11700
- var pre_run_decision_1 = require_pre_run_decision();
11701
- exports2.appBuilderCodegenConfig = {
11702
- codegenRules: [
11703
- { filename: "codegen-instructions.md", content: codegen_rules_1.CODEGEN_RULES }
11704
- ],
11705
- askRules: [{ filename: "ask-instructions.md", content: ask_rules_1.ASK_RULES }],
11706
- decisionCheckers: [pre_run_decision_1.checkSiteUIDecision],
11707
- hooks: []
11708
- };
11709
- }
11710
- });
11711
-
11712
- // dist/opencode-integration/rules/site-data-layer-rules.js
11713
- var require_site_data_layer_rules = __commonJS({
11714
- "dist/opencode-integration/rules/site-data-layer-rules.js"(exports2) {
11715
- "use strict";
11716
- Object.defineProperty(exports2, "__esModule", { value: true });
11717
- exports2.SITE_DATA_LAYER_RULES = void 0;
11718
- exports2.SITE_DATA_LAYER_RULES = `# Site Data Layer Rules
11719
-
11720
- The agent operates on a live Wix site (METASITE_ID is in your prompt context).
11721
-
11722
- For any persistent-data need \u2014 CMS collections, content tables, schemas, data models, or databases that store items \u2014 use the \`wix-site-data-collection\` skill.
11723
-
11724
- The \`wix-app\` skill remains the right tool for surrounding extensions (dashboard pages, modals, widgets); only the data layer is overridden. A Wix CLI data collection extension will NOT work here \u2014 it only provisions on app install, but this is a live site that already exists. Use the \`wix-site-data-collection\` skill to discover the existing collections on the site and wire your code against them.
11725
-
11726
- DO NOT write any code relating to Wix CLI data extensions \u2014 for example, do not generate \`src/extensions/data/extensions.ts\`.`;
11727
- }
11728
- });
11729
-
11730
11741
  // ../../node_modules/@wix/ambassador-code-studio-orchestrator-v1-project/cjs/build/http.impl.js
11731
11742
  var require_http_impl2 = __commonJS({
11732
11743
  "../../node_modules/@wix/ambassador-code-studio-orchestrator-v1-project/cjs/build/http.impl.js"(exports2) {
@@ -12236,6 +12247,12 @@ var require_checkpoint = __commonJS({
12236
12247
  }));
12237
12248
  return { checkpointId: resp.data?.checkpointId };
12238
12249
  };
12250
+ var readBashCommand = (input) => {
12251
+ if (typeof input !== "object" || input === null)
12252
+ return void 0;
12253
+ const value = input.command;
12254
+ return typeof value === "string" ? value : void 0;
12255
+ };
12239
12256
  var readToolCommitMessage = (input) => {
12240
12257
  if (typeof input !== "object" || input === null)
12241
12258
  return void 0;
@@ -12288,7 +12305,7 @@ var require_checkpoint = __commonJS({
12288
12305
  return;
12289
12306
  if (tool !== "bash")
12290
12307
  return;
12291
- const command = state.input?.command;
12308
+ const command = readBashCommand(state.input);
12292
12309
  if (!command || !command.includes(EML_MARKER))
12293
12310
  return;
12294
12311
  const commitMessage = capturedCommitMessage ?? FALLBACK_COMMIT_MESSAGE;
@@ -12326,34 +12343,6 @@ First thing, before writing any code, call the \`set-commit-message\` tool. See
12326
12343
  }
12327
12344
  });
12328
12345
 
12329
- // dist/environments/studio-2.js
12330
- var require_studio_2 = __commonJS({
12331
- "dist/environments/studio-2.js"(exports2) {
12332
- "use strict";
12333
- Object.defineProperty(exports2, "__esModule", { value: true });
12334
- exports2.studio2CodegenConfig = void 0;
12335
- var codegen_rules_1 = require_codegen_rules();
12336
- var ask_rules_1 = require_ask_rules();
12337
- var site_data_layer_rules_1 = require_site_data_layer_rules();
12338
- var checkpoint_1 = require_checkpoint();
12339
- var checkpoint_rules_1 = require_checkpoint_rules();
12340
- exports2.studio2CodegenConfig = {
12341
- codegenRules: [
12342
- { filename: "codegen-instructions.md", content: codegen_rules_1.CODEGEN_RULES },
12343
- {
12344
- filename: "checkpoint-commit-message.md",
12345
- content: checkpoint_rules_1.CHECKPOINT_COMMIT_MESSAGE_RULES
12346
- },
12347
- { filename: "site-data-layer-rules.md", content: site_data_layer_rules_1.SITE_DATA_LAYER_RULES }
12348
- ],
12349
- askRules: [{ filename: "ask-instructions.md", content: ask_rules_1.ASK_RULES }],
12350
- decisionCheckers: [],
12351
- hooks: [checkpoint_1.checkpointHookFactory],
12352
- tools: ["set-commit-message.ts"]
12353
- };
12354
- }
12355
- });
12356
-
12357
12346
  // dist/environments/hooks/run-hooks.js
12358
12347
  var require_run_hooks = __commonJS({
12359
12348
  "dist/environments/hooks/run-hooks.js"(exports2) {
@@ -12403,7 +12392,7 @@ var require_run_hooks = __commonJS({
12403
12392
  });
12404
12393
 
12405
12394
  // dist/environments/hooks/index.js
12406
- var require_hooks = __commonJS({
12395
+ var require_hooks2 = __commonJS({
12407
12396
  "dist/environments/hooks/index.js"(exports2) {
12408
12397
  "use strict";
12409
12398
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -12429,19 +12418,57 @@ var require_environments = __commonJS({
12429
12418
  exports2.getActiveHooks = void 0;
12430
12419
  exports2.getCodegenEnvironmentConfig = getCodegenEnvironmentConfig;
12431
12420
  var types_1 = require_types_impl();
12432
- var app_builder_1 = require_app_builder();
12433
- var studio_2_1 = require_studio_2();
12434
- var hooks_1 = require_hooks();
12421
+ var codegen_app_builder_config_1 = require_dist5();
12422
+ var codegen_studio_2_config_1 = require_dist6();
12423
+ var codegen_rules_1 = require_codegen_rules();
12424
+ var ask_rules_1 = require_ask_rules();
12425
+ var job_decision_manager_1 = require_job_decision_manager();
12426
+ var logger_12 = require_logger();
12427
+ var checkpoint_1 = require_checkpoint();
12428
+ var checkpoint_rules_1 = require_checkpoint_rules();
12429
+ var hooks_1 = require_hooks2();
12435
12430
  Object.defineProperty(exports2, "getActiveHooks", { enumerable: true, get: function() {
12436
12431
  return hooks_1.getActiveHooks;
12437
12432
  } });
12433
+ var SHARED_CODEGEN_RULE = {
12434
+ filename: "codegen-instructions.md",
12435
+ content: codegen_rules_1.CODEGEN_RULES
12436
+ };
12437
+ var SHARED_ASK_RULE = {
12438
+ filename: "ask-instructions.md",
12439
+ content: ask_rules_1.ASK_RULES
12440
+ };
12441
+ var withSharedRules = (env) => ({
12442
+ ...env,
12443
+ codegenRules: [SHARED_CODEGEN_RULE, ...env.codegenRules],
12444
+ askRules: [SHARED_ASK_RULE, ...env.askRules]
12445
+ });
12438
12446
  function getCodegenEnvironmentConfig() {
12439
12447
  switch (process.env.CODEGEN_ENVIRONMENT) {
12440
12448
  case types_1.Environment.STUDIO_2:
12441
- return studio_2_1.studio2CodegenConfig;
12449
+ return withSharedRules({
12450
+ ...codegen_studio_2_config_1.studio2CodegenConfig,
12451
+ codegenRules: [
12452
+ {
12453
+ filename: "checkpoint-commit-message.md",
12454
+ content: checkpoint_rules_1.CHECKPOINT_COMMIT_MESSAGE_RULES
12455
+ },
12456
+ ...codegen_studio_2_config_1.studio2CodegenConfig.codegenRules
12457
+ ],
12458
+ hooks: [checkpoint_1.checkpointHookFactory],
12459
+ tools: ["set-commit-message.ts"]
12460
+ });
12442
12461
  case types_1.Environment.APP_BUILDER:
12443
12462
  default:
12444
- return app_builder_1.appBuilderCodegenConfig;
12463
+ return withSharedRules({
12464
+ ...codegen_app_builder_config_1.appBuilderCodegenConfig,
12465
+ decisionCheckers: [
12466
+ (0, codegen_app_builder_config_1.createCheckSiteUIDecision)({
12467
+ askChoice: job_decision_manager_1.askJobChoice,
12468
+ logger: logger_12.logger
12469
+ })
12470
+ ]
12471
+ });
12445
12472
  }
12446
12473
  }
12447
12474
  }
@@ -12455,6 +12482,7 @@ var require_config = __commonJS({
12455
12482
  exports2.DEFAULT_SMALL_MODEL = exports2.DEFAULT_MODEL = exports2.DEFAULT_TIMEOUT_MS = void 0;
12456
12483
  exports2.getAnthropicBaseUrl = getAnthropicBaseUrl;
12457
12484
  exports2.setCurrentAccessToken = setCurrentAccessToken;
12485
+ exports2.getCurrentAccessToken = getCurrentAccessToken;
12458
12486
  exports2.getOpenCodeEnv = getOpenCodeEnv;
12459
12487
  var os_1 = require("os");
12460
12488
  var constants_1 = require_constants5();
@@ -12476,6 +12504,9 @@ var require_config = __commonJS({
12476
12504
  currentAccessToken = token;
12477
12505
  process.env.WIX_ACCESS_TOKEN = token;
12478
12506
  }
12507
+ function getCurrentAccessToken() {
12508
+ return currentAccessToken;
12509
+ }
12479
12510
  function getProviderConfig() {
12480
12511
  const headers = currentAccessToken ? { Authorization: `Bearer ${currentAccessToken}` } : {};
12481
12512
  return {
@@ -12956,7 +12987,7 @@ var require_task_tracker = __commonJS({
12956
12987
  var types_1 = require_types4();
12957
12988
  var logger_12 = require_logger();
12958
12989
  var progress_handler_1 = require_progress_handler();
12959
- var hooks_1 = require_hooks();
12990
+ var hooks_1 = require_hooks2();
12960
12991
  var OpenCodeTaskTracker = class {
12961
12992
  constructor(workingDirectory) {
12962
12993
  this.skillsUsed = /* @__PURE__ */ new Set();
@@ -15871,7 +15902,7 @@ var require_bi_logger_factory = __commonJS({
15871
15902
  });
15872
15903
 
15873
15904
  // ../../node_modules/@wix/wix-bi-logger-client/dist/index.js
15874
- var require_dist5 = __commonJS({
15905
+ var require_dist7 = __commonJS({
15875
15906
  "../../node_modules/@wix/wix-bi-logger-client/dist/index.js"(exports2, module2) {
15876
15907
  "use strict";
15877
15908
  var BiLoggerClientFactory = require_bi_logger_factory();
@@ -18471,7 +18502,7 @@ var require_src2 = __commonJS({
18471
18502
  Object.defineProperty(exports2, "__esModule", { value: true });
18472
18503
  exports2.StandaloneNodeLogger = void 0;
18473
18504
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
18474
- var wix_bi_logger_client_1 = tslib_1.__importDefault(require_dist5());
18505
+ var wix_bi_logger_client_1 = tslib_1.__importDefault(require_dist7());
18475
18506
  var http_client_1 = require_index_node2();
18476
18507
  var defaultOptions = {
18477
18508
  baseUrl: process.env.BI_BASE_URL || "https://frog.wix.com",
@@ -18671,6 +18702,29 @@ var require_biEvents = __commonJS({
18671
18702
  }
18672
18703
  });
18673
18704
 
18705
+ // dist/pre-run-decision.js
18706
+ var require_pre_run_decision = __commonJS({
18707
+ "dist/pre-run-decision.js"(exports2) {
18708
+ "use strict";
18709
+ Object.defineProperty(exports2, "__esModule", { value: true });
18710
+ exports2.runPreDecisionCheck = runPreDecisionCheck;
18711
+ async function runPreDecisionCheck(jobId, context, checkers) {
18712
+ const allDecisions = [];
18713
+ let modifiedPayload = context.payload;
18714
+ for (const checker of checkers) {
18715
+ const result = await checker(jobId, { payload: modifiedPayload });
18716
+ if (result) {
18717
+ allDecisions.push(...result.decisionsApplied);
18718
+ if (result.modifiedPayload) {
18719
+ modifiedPayload = result.modifiedPayload;
18720
+ }
18721
+ }
18722
+ }
18723
+ return { decisionsApplied: allDecisions, modifiedPayload };
18724
+ }
18725
+ }
18726
+ });
18727
+
18674
18728
  // dist/flows/opencode-init.js
18675
18729
  var require_opencode_init = __commonJS({
18676
18730
  "dist/flows/opencode-init.js"(exports2) {
@@ -18694,7 +18748,7 @@ var require_opencode_init = __commonJS({
18694
18748
  var biEvents_1 = require_biEvents();
18695
18749
  var pre_run_decision_1 = require_pre_run_decision();
18696
18750
  var environments_12 = require_environments();
18697
- var hooks_1 = require_hooks();
18751
+ var hooks_1 = require_hooks2();
18698
18752
  var runOpencodeInitFlow = async (blueprint, history, agentData) => {
18699
18753
  const store = job_context_storage_12.jobContextStorage.getStore();
18700
18754
  if (!store?.jobId || !store?.taskId) {
@@ -18890,7 +18944,7 @@ var require_opencode_iterate = __commonJS({
18890
18944
  var inject_created_by_1 = require_inject_created_by();
18891
18945
  var collect_extensions_created_1 = require_collect_extensions_created();
18892
18946
  var biEvents_1 = require_biEvents();
18893
- var hooks_1 = require_hooks();
18947
+ var hooks_1 = require_hooks2();
18894
18948
  var runOpencodeIterateFlow = async (chatHistory, agentData) => {
18895
18949
  const store = job_context_storage_12.jobContextStorage.getStore();
18896
18950
  if (!store?.jobId || !store?.taskId) {
@@ -19548,7 +19602,13 @@ function buildHooksForTask(jobId, taskId, kind, payload) {
19548
19602
  return void 0;
19549
19603
  }
19550
19604
  const userInput = extractUserInput(kind, payload);
19551
- return (0, environments_1.getCodegenEnvironmentConfig)().hooks.map((factory) => factory({ projectId: context_1.ctx.projectId, jobId, taskId, kind, userInput }));
19605
+ return (0, environments_1.getCodegenEnvironmentConfig)().hooks.map((factory) => factory({
19606
+ projectId: context_1.ctx.projectId,
19607
+ jobId,
19608
+ taskId,
19609
+ kind,
19610
+ userInput
19611
+ }));
19552
19612
  }
19553
19613
  function extractUserInput(kind, payload) {
19554
19614
  if (kind === CodeGenService_1.TaskKind.INIT_CODEGEN) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.340",
3
+ "version": "1.0.342",
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
  "esbuild": "^0.27.2",
29
29
  "vitest": "^4.0.16"
30
30
  },
31
- "falconPackageHash": "083dcfde12b66d5d64dc808fa7424e7c2da18420e5ff31c935e04bc6"
31
+ "falconPackageHash": "7cf9fd060218273d0308e46986b968282c4c4572ad93d8b826ea380d"
32
32
  }