@wix/ditto-codegen-public 1.0.331 → 1.0.333
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 +108 -7
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -11436,6 +11436,14 @@ var require_user_decision = __commonJS({
|
|
|
11436
11436
|
}
|
|
11437
11437
|
});
|
|
11438
11438
|
|
|
11439
|
+
// ../codegen-types/dist/types/job-payload.js
|
|
11440
|
+
var require_job_payload = __commonJS({
|
|
11441
|
+
"../codegen-types/dist/types/job-payload.js"(exports2) {
|
|
11442
|
+
"use strict";
|
|
11443
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11444
|
+
}
|
|
11445
|
+
});
|
|
11446
|
+
|
|
11439
11447
|
// ../codegen-types/dist/ai/index.js
|
|
11440
11448
|
var require_ai = __commonJS({
|
|
11441
11449
|
"../codegen-types/dist/ai/index.js"(exports2) {
|
|
@@ -11479,6 +11487,7 @@ var require_dist4 = __commonJS({
|
|
|
11479
11487
|
__exportStar2(require_task(), exports2);
|
|
11480
11488
|
__exportStar2(require_generation(), exports2);
|
|
11481
11489
|
__exportStar2(require_user_decision(), exports2);
|
|
11490
|
+
__exportStar2(require_job_payload(), exports2);
|
|
11482
11491
|
__exportStar2(require_ai(), exports2);
|
|
11483
11492
|
}
|
|
11484
11493
|
});
|
|
@@ -11676,6 +11685,7 @@ var require_constants5 = __commonJS({
|
|
|
11676
11685
|
exports2.detectExtension = detectExtension;
|
|
11677
11686
|
exports2.toTitleCase = toTitleCase;
|
|
11678
11687
|
exports2.extractExtensionName = extractExtensionName;
|
|
11688
|
+
exports2.extractExtensionDisplayTitle = extractExtensionDisplayTitle;
|
|
11679
11689
|
exports2.injectCreatedBy = injectCreatedBy;
|
|
11680
11690
|
exports2.getWrittenContent = getWrittenContent;
|
|
11681
11691
|
var ditto_codegen_types_12 = require_dist4();
|
|
@@ -11754,6 +11764,33 @@ var require_constants5 = __commonJS({
|
|
|
11754
11764
|
const folderName = parts[parts.length - 2] || "";
|
|
11755
11765
|
return toTitleCase(folderName);
|
|
11756
11766
|
}
|
|
11767
|
+
function matchQuotedExtensionConfigProperty(content, propName) {
|
|
11768
|
+
const objectPropertyQuotedStringValuePattern = `\\b${propName}\\s*:\\s*(?:"([^"\\\\]*)"|'([^'\\\\]*)')`;
|
|
11769
|
+
const objectPropertyQuotedStringValueRegex = new RegExp(
|
|
11770
|
+
objectPropertyQuotedStringValuePattern,
|
|
11771
|
+
// `m` = multiline: `^` / `$` match line starts/ends, not only the whole string.
|
|
11772
|
+
"m"
|
|
11773
|
+
);
|
|
11774
|
+
const quotedStringValueMatch = content.match(objectPropertyQuotedStringValueRegex);
|
|
11775
|
+
if (!quotedStringValueMatch)
|
|
11776
|
+
return null;
|
|
11777
|
+
return quotedStringValueMatch[1] ?? quotedStringValueMatch[2] ?? null;
|
|
11778
|
+
}
|
|
11779
|
+
function extractExtensionDisplayTitle(content, filePath) {
|
|
11780
|
+
const title = matchQuotedExtensionConfigProperty(content, "title");
|
|
11781
|
+
if (title)
|
|
11782
|
+
return title;
|
|
11783
|
+
const name = matchQuotedExtensionConfigProperty(content, "name");
|
|
11784
|
+
if (name)
|
|
11785
|
+
return name;
|
|
11786
|
+
const displayName = matchQuotedExtensionConfigProperty(content, "displayName");
|
|
11787
|
+
if (displayName)
|
|
11788
|
+
return displayName;
|
|
11789
|
+
const idSuffix = matchQuotedExtensionConfigProperty(content, "idSuffix");
|
|
11790
|
+
if (idSuffix)
|
|
11791
|
+
return idSuffix;
|
|
11792
|
+
return extractExtensionName(filePath);
|
|
11793
|
+
}
|
|
11757
11794
|
function injectCreatedBy(content) {
|
|
11758
11795
|
if (content.includes("createdBy"))
|
|
11759
11796
|
return content;
|
|
@@ -14232,12 +14269,54 @@ var require_opencode_runner = __commonJS({
|
|
|
14232
14269
|
}
|
|
14233
14270
|
});
|
|
14234
14271
|
|
|
14272
|
+
// dist/opencode-integration/collect-extensions-created.js
|
|
14273
|
+
var require_collect_extensions_created = __commonJS({
|
|
14274
|
+
"dist/opencode-integration/collect-extensions-created.js"(exports2) {
|
|
14275
|
+
"use strict";
|
|
14276
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
14277
|
+
exports2.collectInsertedExtensionsMetadata = collectInsertedExtensionsMetadata;
|
|
14278
|
+
exports2.buildExtensionsJobPayload = buildExtensionsJobPayload;
|
|
14279
|
+
var path_1 = require("path");
|
|
14280
|
+
var promises_1 = require("fs/promises");
|
|
14281
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
14282
|
+
var constants_1 = require_constants5();
|
|
14283
|
+
async function collectInsertedExtensionsMetadata(outputPath, files) {
|
|
14284
|
+
const results = [];
|
|
14285
|
+
for (const f of files) {
|
|
14286
|
+
if (f.operation !== ditto_codegen_types_12.ExtensionGenerationOperation.INSERT)
|
|
14287
|
+
continue;
|
|
14288
|
+
if (!(0, constants_1.isExtensionsFile)(f.path))
|
|
14289
|
+
continue;
|
|
14290
|
+
const fullPath = (0, path_1.isAbsolute)(f.path) ? f.path : (0, path_1.join)(outputPath, f.path);
|
|
14291
|
+
try {
|
|
14292
|
+
const content = await (0, promises_1.readFile)(fullPath, "utf-8");
|
|
14293
|
+
const detected = (0, constants_1.detectExtension)(content);
|
|
14294
|
+
if (!detected)
|
|
14295
|
+
continue;
|
|
14296
|
+
results.push({
|
|
14297
|
+
path: f.path,
|
|
14298
|
+
extensionType: detected.extensionType,
|
|
14299
|
+
title: (0, constants_1.extractExtensionDisplayTitle)(content, f.path)
|
|
14300
|
+
});
|
|
14301
|
+
} catch {
|
|
14302
|
+
continue;
|
|
14303
|
+
}
|
|
14304
|
+
}
|
|
14305
|
+
return results;
|
|
14306
|
+
}
|
|
14307
|
+
async function buildExtensionsJobPayload(outputPath, files) {
|
|
14308
|
+
const created = await collectInsertedExtensionsMetadata(outputPath, files);
|
|
14309
|
+
return { created };
|
|
14310
|
+
}
|
|
14311
|
+
}
|
|
14312
|
+
});
|
|
14313
|
+
|
|
14235
14314
|
// dist/opencode-integration/index.js
|
|
14236
14315
|
var require_opencode_integration = __commonJS({
|
|
14237
14316
|
"dist/opencode-integration/index.js"(exports2) {
|
|
14238
14317
|
"use strict";
|
|
14239
14318
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
14240
|
-
exports2.OpenCodeTaskTracker = exports2.runOpenCodeAsk = exports2.runOpenCodeIteration = exports2.runOpenCodeInit = void 0;
|
|
14319
|
+
exports2.collectInsertedExtensionsMetadata = exports2.buildExtensionsJobPayload = exports2.OpenCodeTaskTracker = exports2.runOpenCodeAsk = exports2.runOpenCodeIteration = exports2.runOpenCodeInit = void 0;
|
|
14241
14320
|
var opencode_runner_1 = require_opencode_runner();
|
|
14242
14321
|
Object.defineProperty(exports2, "runOpenCodeInit", { enumerable: true, get: function() {
|
|
14243
14322
|
return opencode_runner_1.runOpenCodeInit;
|
|
@@ -14252,6 +14331,13 @@ var require_opencode_integration = __commonJS({
|
|
|
14252
14331
|
Object.defineProperty(exports2, "OpenCodeTaskTracker", { enumerable: true, get: function() {
|
|
14253
14332
|
return task_tracker_1.OpenCodeTaskTracker;
|
|
14254
14333
|
} });
|
|
14334
|
+
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
14335
|
+
Object.defineProperty(exports2, "buildExtensionsJobPayload", { enumerable: true, get: function() {
|
|
14336
|
+
return collect_extensions_created_1.buildExtensionsJobPayload;
|
|
14337
|
+
} });
|
|
14338
|
+
Object.defineProperty(exports2, "collectInsertedExtensionsMetadata", { enumerable: true, get: function() {
|
|
14339
|
+
return collect_extensions_created_1.collectInsertedExtensionsMetadata;
|
|
14340
|
+
} });
|
|
14255
14341
|
}
|
|
14256
14342
|
});
|
|
14257
14343
|
|
|
@@ -19399,6 +19485,7 @@ var require_opencode_init = __commonJS({
|
|
|
19399
19485
|
var logger_12 = require_logger();
|
|
19400
19486
|
var config_12 = require_config();
|
|
19401
19487
|
var git_file_changes_1 = require_git_file_changes();
|
|
19488
|
+
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19402
19489
|
var biEvents_1 = require_biEvents();
|
|
19403
19490
|
var pre_run_decision_1 = require_pre_run_decision();
|
|
19404
19491
|
var environments_12 = require_environments();
|
|
@@ -19454,11 +19541,13 @@ var require_opencode_init = __commonJS({
|
|
|
19454
19541
|
});
|
|
19455
19542
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19456
19543
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19544
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19457
19545
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19458
19546
|
requiredPermissions: result.requiredPermissions,
|
|
19459
19547
|
files,
|
|
19460
19548
|
history,
|
|
19461
|
-
...agentOutput
|
|
19549
|
+
...agentOutput,
|
|
19550
|
+
extensions
|
|
19462
19551
|
});
|
|
19463
19552
|
if (!store.isCompleted) {
|
|
19464
19553
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {});
|
|
@@ -19480,12 +19569,14 @@ var require_opencode_init = __commonJS({
|
|
|
19480
19569
|
const codegenError = (0, ditto_codegen_types_2.toCodegenError)(error);
|
|
19481
19570
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19482
19571
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19572
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19483
19573
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19484
19574
|
requiredPermissions: [],
|
|
19485
19575
|
requiredPermissionsErrors: codegenError,
|
|
19486
19576
|
files,
|
|
19487
19577
|
history,
|
|
19488
|
-
...agentOutput
|
|
19578
|
+
...agentOutput,
|
|
19579
|
+
extensions
|
|
19489
19580
|
});
|
|
19490
19581
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
19491
19582
|
(0, biEvents_1.reportSessionEnd)({
|
|
@@ -19592,6 +19683,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
19592
19683
|
var logger_12 = require_logger();
|
|
19593
19684
|
var config_12 = require_config();
|
|
19594
19685
|
var git_file_changes_1 = require_git_file_changes();
|
|
19686
|
+
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19595
19687
|
var biEvents_1 = require_biEvents();
|
|
19596
19688
|
var hooks_1 = require_hooks();
|
|
19597
19689
|
var runOpencodeIterateFlow = async (chatHistory, agentData) => {
|
|
@@ -19635,10 +19727,12 @@ var require_opencode_iterate = __commonJS({
|
|
|
19635
19727
|
});
|
|
19636
19728
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19637
19729
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19730
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19638
19731
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19639
19732
|
requiredPermissions: result.requiredPermissions,
|
|
19640
19733
|
files,
|
|
19641
|
-
...agentOutput
|
|
19734
|
+
...agentOutput,
|
|
19735
|
+
extensions
|
|
19642
19736
|
});
|
|
19643
19737
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {
|
|
19644
19738
|
taskOutput: { files }
|
|
@@ -19660,11 +19754,13 @@ var require_opencode_iterate = __commonJS({
|
|
|
19660
19754
|
const codegenError = (0, ditto_codegen_types_2.toCodegenError)(error);
|
|
19661
19755
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19662
19756
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19757
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19663
19758
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19664
19759
|
requiredPermissions: [],
|
|
19665
19760
|
requiredPermissionsErrors: codegenError,
|
|
19666
19761
|
files,
|
|
19667
|
-
...agentOutput
|
|
19762
|
+
...agentOutput,
|
|
19763
|
+
extensions
|
|
19668
19764
|
});
|
|
19669
19765
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
19670
19766
|
(0, biEvents_1.reportSessionEnd)({
|
|
@@ -19769,6 +19865,7 @@ var require_opencode_ask = __commonJS({
|
|
|
19769
19865
|
var logger_12 = require_logger();
|
|
19770
19866
|
var config_12 = require_config();
|
|
19771
19867
|
var git_file_changes_1 = require_git_file_changes();
|
|
19868
|
+
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19772
19869
|
var biEvents_1 = require_biEvents();
|
|
19773
19870
|
var runOpencodeAskFlow = async (chatHistory) => {
|
|
19774
19871
|
const store = job_context_storage_12.jobContextStorage.getStore();
|
|
@@ -19808,8 +19905,10 @@ var require_opencode_ask = __commonJS({
|
|
|
19808
19905
|
chatHistory
|
|
19809
19906
|
});
|
|
19810
19907
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19908
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19811
19909
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19812
|
-
files
|
|
19910
|
+
files,
|
|
19911
|
+
extensions
|
|
19813
19912
|
});
|
|
19814
19913
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {
|
|
19815
19914
|
taskOutput: {
|
|
@@ -19829,8 +19928,10 @@ var require_opencode_ask = __commonJS({
|
|
|
19829
19928
|
} catch (error) {
|
|
19830
19929
|
const codegenError = (0, ditto_codegen_types_2.toCodegenError)(error);
|
|
19831
19930
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19931
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19832
19932
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19833
|
-
files
|
|
19933
|
+
files,
|
|
19934
|
+
extensions
|
|
19834
19935
|
});
|
|
19835
19936
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
19836
19937
|
(0, biEvents_1.reportSessionEnd)({
|
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.333",
|
|
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": "71e0cb11521025658086973a2e5d0df964770541571af17c1894297e"
|
|
32
32
|
}
|