@wix/ditto-codegen-public 1.0.341 → 1.0.343
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 +274 -201
- 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,134 +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 options = [
|
|
11629
|
-
{
|
|
11630
|
-
id: types_1.ExtensionType.CUSTOM_ELEMENT_WIDGET,
|
|
11631
|
-
label: "Custom Element Widget",
|
|
11632
|
-
description: "A self-contained widget built as a Custom Element, embedded on the site. Best for standalone, reusable components."
|
|
11633
|
-
},
|
|
11634
|
-
{
|
|
11635
|
-
id: types_1.ExtensionType.EDITOR_REACT_COMPONENT,
|
|
11636
|
-
label: "Editor React Component",
|
|
11637
|
-
description: "A React component that integrates with the site builder. Best for components that need to work with Wix editor features."
|
|
11638
|
-
}
|
|
11639
|
-
];
|
|
11640
|
-
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.");
|
|
11641
|
-
const selectedLabel = options.find((o) => o.id === selectedType)?.label ?? selectedType;
|
|
11642
|
-
const isTypeChanged = selectedType !== currentType;
|
|
11643
|
-
logger_12.logger.info(`[PreDecision] User selected ${selectedType} for "${extensionName}"${isTypeChanged ? ` (changed from ${currentType})` : " (unchanged)"}`);
|
|
11644
|
-
const appliedDecision = {
|
|
11645
|
-
type: "SITE_UI_TYPE",
|
|
11646
|
-
question: "Custom Element Widget vs Editor React Component",
|
|
11647
|
-
selectedOptionId: selectedType
|
|
11648
|
-
};
|
|
11649
|
-
return {
|
|
11650
|
-
decisionsApplied: [appliedDecision],
|
|
11651
|
-
modifiedPayload: blueprint ? applyTypeToBlueprint(blueprint, extensionName, selectedType, selectedLabel) : void 0
|
|
11652
|
-
};
|
|
11653
|
-
};
|
|
11654
|
-
exports2.checkSiteUIDecision = checkSiteUIDecision;
|
|
11655
|
-
function isSiteUIExtension(extension) {
|
|
11656
|
-
return extension.type === types_1.ExtensionType.CUSTOM_ELEMENT_WIDGET || extension.type === types_1.ExtensionType.EDITOR_REACT_COMPONENT;
|
|
11657
|
-
}
|
|
11658
|
-
function applyTypeToBlueprint(blueprint, extensionName, type, label) {
|
|
11659
|
-
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.`;
|
|
11660
|
-
const descriptionNotice = `[USER DECISION] This extension MUST be a ${label} (type: ${type}). The user explicitly chose this. Do NOT change it.`;
|
|
11661
|
-
return {
|
|
11662
|
-
...blueprint,
|
|
11663
|
-
summary: `${summaryNotice}
|
|
11664
|
-
|
|
11665
|
-
${blueprint.summary ?? ""}`.trim(),
|
|
11666
|
-
extensions: blueprint.extensions?.map((ext) => ext.name === extensionName ? {
|
|
11667
|
-
...ext,
|
|
11668
|
-
type,
|
|
11669
|
-
description: `${descriptionNotice}
|
|
11670
|
-
|
|
11671
|
-
${ext.description ?? ""}`.trim(),
|
|
11672
|
-
_userDecision: "IMPORTANT: The user explicitly chose this extension type. You MUST use this exact type."
|
|
11673
|
-
} : ext)
|
|
11674
|
-
};
|
|
11675
|
-
}
|
|
11676
|
-
}
|
|
11677
|
-
});
|
|
11678
|
-
|
|
11679
|
-
// dist/environments/app-builder.js
|
|
11680
|
-
var require_app_builder = __commonJS({
|
|
11681
|
-
"dist/environments/app-builder.js"(exports2) {
|
|
11682
|
-
"use strict";
|
|
11683
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11684
|
-
exports2.appBuilderCodegenConfig = void 0;
|
|
11685
|
-
var codegen_rules_1 = require_codegen_rules();
|
|
11686
|
-
var ask_rules_1 = require_ask_rules();
|
|
11687
|
-
var pre_run_decision_1 = require_pre_run_decision();
|
|
11688
|
-
exports2.appBuilderCodegenConfig = {
|
|
11689
|
-
codegenRules: [
|
|
11690
|
-
{ filename: "codegen-instructions.md", content: codegen_rules_1.CODEGEN_RULES }
|
|
11691
|
-
],
|
|
11692
|
-
askRules: [{ filename: "ask-instructions.md", content: ask_rules_1.ASK_RULES }],
|
|
11693
|
-
decisionCheckers: [pre_run_decision_1.checkSiteUIDecision],
|
|
11694
|
-
hooks: []
|
|
11695
|
-
};
|
|
11696
|
-
}
|
|
11697
|
-
});
|
|
11698
|
-
|
|
11699
|
-
// dist/opencode-integration/rules/site-data-layer-rules.js
|
|
11700
|
-
var require_site_data_layer_rules = __commonJS({
|
|
11701
|
-
"dist/opencode-integration/rules/site-data-layer-rules.js"(exports2) {
|
|
11702
|
-
"use strict";
|
|
11703
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11704
|
-
exports2.SITE_DATA_LAYER_RULES = void 0;
|
|
11705
|
-
exports2.SITE_DATA_LAYER_RULES = `# Site Data Layer Rules
|
|
11706
|
-
|
|
11707
|
-
The agent operates on a live Wix site (METASITE_ID is in your prompt context).
|
|
11708
|
-
|
|
11709
|
-
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.
|
|
11710
|
-
|
|
11711
|
-
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.
|
|
11712
|
-
|
|
11713
|
-
DO NOT write any code relating to Wix CLI data extensions \u2014 for example, do not generate \`src/extensions/data/extensions.ts\`.`;
|
|
11714
|
-
}
|
|
11715
|
-
});
|
|
11716
|
-
|
|
11717
11741
|
// ../../node_modules/@wix/ambassador-code-studio-orchestrator-v1-project/cjs/build/http.impl.js
|
|
11718
11742
|
var require_http_impl2 = __commonJS({
|
|
11719
11743
|
"../../node_modules/@wix/ambassador-code-studio-orchestrator-v1-project/cjs/build/http.impl.js"(exports2) {
|
|
@@ -12223,6 +12247,12 @@ var require_checkpoint = __commonJS({
|
|
|
12223
12247
|
}));
|
|
12224
12248
|
return { checkpointId: resp.data?.checkpointId };
|
|
12225
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
|
+
};
|
|
12226
12256
|
var readToolCommitMessage = (input) => {
|
|
12227
12257
|
if (typeof input !== "object" || input === null)
|
|
12228
12258
|
return void 0;
|
|
@@ -12275,7 +12305,7 @@ var require_checkpoint = __commonJS({
|
|
|
12275
12305
|
return;
|
|
12276
12306
|
if (tool !== "bash")
|
|
12277
12307
|
return;
|
|
12278
|
-
const command = state.input
|
|
12308
|
+
const command = readBashCommand(state.input);
|
|
12279
12309
|
if (!command || !command.includes(EML_MARKER))
|
|
12280
12310
|
return;
|
|
12281
12311
|
const commitMessage = capturedCommitMessage ?? FALLBACK_COMMIT_MESSAGE;
|
|
@@ -12313,34 +12343,6 @@ First thing, before writing any code, call the \`set-commit-message\` tool. See
|
|
|
12313
12343
|
}
|
|
12314
12344
|
});
|
|
12315
12345
|
|
|
12316
|
-
// dist/environments/studio-2.js
|
|
12317
|
-
var require_studio_2 = __commonJS({
|
|
12318
|
-
"dist/environments/studio-2.js"(exports2) {
|
|
12319
|
-
"use strict";
|
|
12320
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12321
|
-
exports2.studio2CodegenConfig = void 0;
|
|
12322
|
-
var codegen_rules_1 = require_codegen_rules();
|
|
12323
|
-
var ask_rules_1 = require_ask_rules();
|
|
12324
|
-
var site_data_layer_rules_1 = require_site_data_layer_rules();
|
|
12325
|
-
var checkpoint_1 = require_checkpoint();
|
|
12326
|
-
var checkpoint_rules_1 = require_checkpoint_rules();
|
|
12327
|
-
exports2.studio2CodegenConfig = {
|
|
12328
|
-
codegenRules: [
|
|
12329
|
-
{ filename: "codegen-instructions.md", content: codegen_rules_1.CODEGEN_RULES },
|
|
12330
|
-
{
|
|
12331
|
-
filename: "checkpoint-commit-message.md",
|
|
12332
|
-
content: checkpoint_rules_1.CHECKPOINT_COMMIT_MESSAGE_RULES
|
|
12333
|
-
},
|
|
12334
|
-
{ filename: "site-data-layer-rules.md", content: site_data_layer_rules_1.SITE_DATA_LAYER_RULES }
|
|
12335
|
-
],
|
|
12336
|
-
askRules: [{ filename: "ask-instructions.md", content: ask_rules_1.ASK_RULES }],
|
|
12337
|
-
decisionCheckers: [],
|
|
12338
|
-
hooks: [checkpoint_1.checkpointHookFactory],
|
|
12339
|
-
tools: ["set-commit-message.ts"]
|
|
12340
|
-
};
|
|
12341
|
-
}
|
|
12342
|
-
});
|
|
12343
|
-
|
|
12344
12346
|
// dist/environments/hooks/run-hooks.js
|
|
12345
12347
|
var require_run_hooks = __commonJS({
|
|
12346
12348
|
"dist/environments/hooks/run-hooks.js"(exports2) {
|
|
@@ -12390,7 +12392,7 @@ var require_run_hooks = __commonJS({
|
|
|
12390
12392
|
});
|
|
12391
12393
|
|
|
12392
12394
|
// dist/environments/hooks/index.js
|
|
12393
|
-
var
|
|
12395
|
+
var require_hooks2 = __commonJS({
|
|
12394
12396
|
"dist/environments/hooks/index.js"(exports2) {
|
|
12395
12397
|
"use strict";
|
|
12396
12398
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -12416,19 +12418,57 @@ var require_environments = __commonJS({
|
|
|
12416
12418
|
exports2.getActiveHooks = void 0;
|
|
12417
12419
|
exports2.getCodegenEnvironmentConfig = getCodegenEnvironmentConfig;
|
|
12418
12420
|
var types_1 = require_types_impl();
|
|
12419
|
-
var
|
|
12420
|
-
var
|
|
12421
|
-
var
|
|
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();
|
|
12422
12430
|
Object.defineProperty(exports2, "getActiveHooks", { enumerable: true, get: function() {
|
|
12423
12431
|
return hooks_1.getActiveHooks;
|
|
12424
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
|
+
});
|
|
12425
12446
|
function getCodegenEnvironmentConfig() {
|
|
12426
12447
|
switch (process.env.CODEGEN_ENVIRONMENT) {
|
|
12427
12448
|
case types_1.Environment.STUDIO_2:
|
|
12428
|
-
return
|
|
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
|
+
});
|
|
12429
12461
|
case types_1.Environment.APP_BUILDER:
|
|
12430
12462
|
default:
|
|
12431
|
-
return
|
|
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
|
+
});
|
|
12432
12472
|
}
|
|
12433
12473
|
}
|
|
12434
12474
|
}
|
|
@@ -12442,6 +12482,7 @@ var require_config = __commonJS({
|
|
|
12442
12482
|
exports2.DEFAULT_SMALL_MODEL = exports2.DEFAULT_MODEL = exports2.DEFAULT_TIMEOUT_MS = void 0;
|
|
12443
12483
|
exports2.getAnthropicBaseUrl = getAnthropicBaseUrl;
|
|
12444
12484
|
exports2.setCurrentAccessToken = setCurrentAccessToken;
|
|
12485
|
+
exports2.getCurrentAccessToken = getCurrentAccessToken;
|
|
12445
12486
|
exports2.getOpenCodeEnv = getOpenCodeEnv;
|
|
12446
12487
|
var os_1 = require("os");
|
|
12447
12488
|
var constants_1 = require_constants5();
|
|
@@ -12463,6 +12504,9 @@ var require_config = __commonJS({
|
|
|
12463
12504
|
currentAccessToken = token;
|
|
12464
12505
|
process.env.WIX_ACCESS_TOKEN = token;
|
|
12465
12506
|
}
|
|
12507
|
+
function getCurrentAccessToken() {
|
|
12508
|
+
return currentAccessToken;
|
|
12509
|
+
}
|
|
12466
12510
|
function getProviderConfig() {
|
|
12467
12511
|
const headers = currentAccessToken ? { Authorization: `Bearer ${currentAccessToken}` } : {};
|
|
12468
12512
|
return {
|
|
@@ -12943,7 +12987,7 @@ var require_task_tracker = __commonJS({
|
|
|
12943
12987
|
var types_1 = require_types4();
|
|
12944
12988
|
var logger_12 = require_logger();
|
|
12945
12989
|
var progress_handler_1 = require_progress_handler();
|
|
12946
|
-
var hooks_1 =
|
|
12990
|
+
var hooks_1 = require_hooks2();
|
|
12947
12991
|
var OpenCodeTaskTracker = class {
|
|
12948
12992
|
constructor(workingDirectory) {
|
|
12949
12993
|
this.skillsUsed = /* @__PURE__ */ new Set();
|
|
@@ -15858,7 +15902,7 @@ var require_bi_logger_factory = __commonJS({
|
|
|
15858
15902
|
});
|
|
15859
15903
|
|
|
15860
15904
|
// ../../node_modules/@wix/wix-bi-logger-client/dist/index.js
|
|
15861
|
-
var
|
|
15905
|
+
var require_dist7 = __commonJS({
|
|
15862
15906
|
"../../node_modules/@wix/wix-bi-logger-client/dist/index.js"(exports2, module2) {
|
|
15863
15907
|
"use strict";
|
|
15864
15908
|
var BiLoggerClientFactory = require_bi_logger_factory();
|
|
@@ -18458,7 +18502,7 @@ var require_src2 = __commonJS({
|
|
|
18458
18502
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
18459
18503
|
exports2.StandaloneNodeLogger = void 0;
|
|
18460
18504
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
18461
|
-
var wix_bi_logger_client_1 = tslib_1.__importDefault(
|
|
18505
|
+
var wix_bi_logger_client_1 = tslib_1.__importDefault(require_dist7());
|
|
18462
18506
|
var http_client_1 = require_index_node2();
|
|
18463
18507
|
var defaultOptions = {
|
|
18464
18508
|
baseUrl: process.env.BI_BASE_URL || "https://frog.wix.com",
|
|
@@ -18658,6 +18702,29 @@ var require_biEvents = __commonJS({
|
|
|
18658
18702
|
}
|
|
18659
18703
|
});
|
|
18660
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
|
+
|
|
18661
18728
|
// dist/flows/opencode-init.js
|
|
18662
18729
|
var require_opencode_init = __commonJS({
|
|
18663
18730
|
"dist/flows/opencode-init.js"(exports2) {
|
|
@@ -18681,7 +18748,7 @@ var require_opencode_init = __commonJS({
|
|
|
18681
18748
|
var biEvents_1 = require_biEvents();
|
|
18682
18749
|
var pre_run_decision_1 = require_pre_run_decision();
|
|
18683
18750
|
var environments_12 = require_environments();
|
|
18684
|
-
var hooks_1 =
|
|
18751
|
+
var hooks_1 = require_hooks2();
|
|
18685
18752
|
var runOpencodeInitFlow = async (blueprint, history, agentData) => {
|
|
18686
18753
|
const store = job_context_storage_12.jobContextStorage.getStore();
|
|
18687
18754
|
if (!store?.jobId || !store?.taskId) {
|
|
@@ -18877,7 +18944,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
18877
18944
|
var inject_created_by_1 = require_inject_created_by();
|
|
18878
18945
|
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
18879
18946
|
var biEvents_1 = require_biEvents();
|
|
18880
|
-
var hooks_1 =
|
|
18947
|
+
var hooks_1 = require_hooks2();
|
|
18881
18948
|
var runOpencodeIterateFlow = async (chatHistory, agentData) => {
|
|
18882
18949
|
const store = job_context_storage_12.jobContextStorage.getStore();
|
|
18883
18950
|
if (!store?.jobId || !store?.taskId) {
|
|
@@ -19300,13 +19367,13 @@ var require_skills_override = __commonJS({
|
|
|
19300
19367
|
var execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
19301
19368
|
exports2.SKILLS_DIR = "/root/.agents/skills";
|
|
19302
19369
|
function tarballUrl(repo, branch) {
|
|
19303
|
-
return `https://github.com/${repo}/archive/${branch}.tar.gz`;
|
|
19370
|
+
return `https://github.com/${repo}/archive/refs/heads/${branch}.tar.gz`;
|
|
19304
19371
|
}
|
|
19305
19372
|
function buildListSkillsCommand(repo, branch) {
|
|
19306
|
-
return `curl -sL ${tarballUrl(repo, branch)} | tar tz --wildcards "*/skills/*" | sed 's
|
|
19373
|
+
return `curl -sL ${tarballUrl(repo, branch)} | tar tz --wildcards "*/skills/*" | sed 's|^.*/skills/||' | cut -d/ -f1 | grep -v '^$' | sort -u`;
|
|
19307
19374
|
}
|
|
19308
19375
|
function buildOverrideCommand(repo, branch) {
|
|
19309
|
-
return `
|
|
19376
|
+
return `tmp=$(mktemp -d) && curl -sL ${tarballUrl(repo, branch)} | tar xz -C $tmp --strip-components=1 && [ -d "$tmp/skills" ] && mkdir -p ${exports2.SKILLS_DIR} && cp -r "$tmp/skills"/. ${exports2.SKILLS_DIR}/ && rm -rf $tmp`;
|
|
19310
19377
|
}
|
|
19311
19378
|
function parseSkillsOverrides(value) {
|
|
19312
19379
|
return value.split(",").map((entry) => entry.trim()).filter(Boolean).map((entry) => {
|
|
@@ -19535,7 +19602,13 @@ function buildHooksForTask(jobId, taskId, kind, payload) {
|
|
|
19535
19602
|
return void 0;
|
|
19536
19603
|
}
|
|
19537
19604
|
const userInput = extractUserInput(kind, payload);
|
|
19538
|
-
return (0, environments_1.getCodegenEnvironmentConfig)().hooks.map((factory) => factory({
|
|
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
|
+
}));
|
|
19539
19612
|
}
|
|
19540
19613
|
function extractUserInput(kind, payload) {
|
|
19541
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.
|
|
3
|
+
"version": "1.0.343",
|
|
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": "
|
|
31
|
+
"falconPackageHash": "360712f8354119b47d18976ea1e3117c78e7c047dff49dedd2cc1dad"
|
|
32
32
|
}
|