@wix/ditto-codegen-public 1.0.331 → 1.0.332
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 +99 -7
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -11676,6 +11676,7 @@ var require_constants5 = __commonJS({
|
|
|
11676
11676
|
exports2.detectExtension = detectExtension;
|
|
11677
11677
|
exports2.toTitleCase = toTitleCase;
|
|
11678
11678
|
exports2.extractExtensionName = extractExtensionName;
|
|
11679
|
+
exports2.extractExtensionDisplayTitle = extractExtensionDisplayTitle;
|
|
11679
11680
|
exports2.injectCreatedBy = injectCreatedBy;
|
|
11680
11681
|
exports2.getWrittenContent = getWrittenContent;
|
|
11681
11682
|
var ditto_codegen_types_12 = require_dist4();
|
|
@@ -11754,6 +11755,33 @@ var require_constants5 = __commonJS({
|
|
|
11754
11755
|
const folderName = parts[parts.length - 2] || "";
|
|
11755
11756
|
return toTitleCase(folderName);
|
|
11756
11757
|
}
|
|
11758
|
+
function matchQuotedExtensionConfigProperty(content, propName) {
|
|
11759
|
+
const objectPropertyQuotedStringValuePattern = `\\b${propName}\\s*:\\s*(?:"([^"\\\\]*)"|'([^'\\\\]*)')`;
|
|
11760
|
+
const objectPropertyQuotedStringValueRegex = new RegExp(
|
|
11761
|
+
objectPropertyQuotedStringValuePattern,
|
|
11762
|
+
// `m` = multiline: `^` / `$` match line starts/ends, not only the whole string.
|
|
11763
|
+
"m"
|
|
11764
|
+
);
|
|
11765
|
+
const quotedStringValueMatch = content.match(objectPropertyQuotedStringValueRegex);
|
|
11766
|
+
if (!quotedStringValueMatch)
|
|
11767
|
+
return null;
|
|
11768
|
+
return quotedStringValueMatch[1] ?? quotedStringValueMatch[2] ?? null;
|
|
11769
|
+
}
|
|
11770
|
+
function extractExtensionDisplayTitle(content, filePath) {
|
|
11771
|
+
const title = matchQuotedExtensionConfigProperty(content, "title");
|
|
11772
|
+
if (title)
|
|
11773
|
+
return title;
|
|
11774
|
+
const name = matchQuotedExtensionConfigProperty(content, "name");
|
|
11775
|
+
if (name)
|
|
11776
|
+
return name;
|
|
11777
|
+
const displayName = matchQuotedExtensionConfigProperty(content, "displayName");
|
|
11778
|
+
if (displayName)
|
|
11779
|
+
return displayName;
|
|
11780
|
+
const idSuffix = matchQuotedExtensionConfigProperty(content, "idSuffix");
|
|
11781
|
+
if (idSuffix)
|
|
11782
|
+
return idSuffix;
|
|
11783
|
+
return extractExtensionName(filePath);
|
|
11784
|
+
}
|
|
11757
11785
|
function injectCreatedBy(content) {
|
|
11758
11786
|
if (content.includes("createdBy"))
|
|
11759
11787
|
return content;
|
|
@@ -14232,12 +14260,54 @@ var require_opencode_runner = __commonJS({
|
|
|
14232
14260
|
}
|
|
14233
14261
|
});
|
|
14234
14262
|
|
|
14263
|
+
// dist/opencode-integration/collect-extensions-created.js
|
|
14264
|
+
var require_collect_extensions_created = __commonJS({
|
|
14265
|
+
"dist/opencode-integration/collect-extensions-created.js"(exports2) {
|
|
14266
|
+
"use strict";
|
|
14267
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
14268
|
+
exports2.collectInsertedExtensionsMetadata = collectInsertedExtensionsMetadata;
|
|
14269
|
+
exports2.buildExtensionsJobPayload = buildExtensionsJobPayload;
|
|
14270
|
+
var path_1 = require("path");
|
|
14271
|
+
var promises_1 = require("fs/promises");
|
|
14272
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
14273
|
+
var constants_1 = require_constants5();
|
|
14274
|
+
async function collectInsertedExtensionsMetadata(outputPath, files) {
|
|
14275
|
+
const results = [];
|
|
14276
|
+
for (const f of files) {
|
|
14277
|
+
if (f.operation !== ditto_codegen_types_12.ExtensionGenerationOperation.INSERT)
|
|
14278
|
+
continue;
|
|
14279
|
+
if (!(0, constants_1.isExtensionsFile)(f.path))
|
|
14280
|
+
continue;
|
|
14281
|
+
const fullPath = (0, path_1.isAbsolute)(f.path) ? f.path : (0, path_1.join)(outputPath, f.path);
|
|
14282
|
+
try {
|
|
14283
|
+
const content = await (0, promises_1.readFile)(fullPath, "utf-8");
|
|
14284
|
+
const detected = (0, constants_1.detectExtension)(content);
|
|
14285
|
+
if (!detected)
|
|
14286
|
+
continue;
|
|
14287
|
+
results.push({
|
|
14288
|
+
path: f.path,
|
|
14289
|
+
extensionType: detected.extensionType,
|
|
14290
|
+
title: (0, constants_1.extractExtensionDisplayTitle)(content, f.path)
|
|
14291
|
+
});
|
|
14292
|
+
} catch {
|
|
14293
|
+
continue;
|
|
14294
|
+
}
|
|
14295
|
+
}
|
|
14296
|
+
return results;
|
|
14297
|
+
}
|
|
14298
|
+
async function buildExtensionsJobPayload(outputPath, files) {
|
|
14299
|
+
const created = await collectInsertedExtensionsMetadata(outputPath, files);
|
|
14300
|
+
return { created };
|
|
14301
|
+
}
|
|
14302
|
+
}
|
|
14303
|
+
});
|
|
14304
|
+
|
|
14235
14305
|
// dist/opencode-integration/index.js
|
|
14236
14306
|
var require_opencode_integration = __commonJS({
|
|
14237
14307
|
"dist/opencode-integration/index.js"(exports2) {
|
|
14238
14308
|
"use strict";
|
|
14239
14309
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
14240
|
-
exports2.OpenCodeTaskTracker = exports2.runOpenCodeAsk = exports2.runOpenCodeIteration = exports2.runOpenCodeInit = void 0;
|
|
14310
|
+
exports2.collectInsertedExtensionsMetadata = exports2.buildExtensionsJobPayload = exports2.OpenCodeTaskTracker = exports2.runOpenCodeAsk = exports2.runOpenCodeIteration = exports2.runOpenCodeInit = void 0;
|
|
14241
14311
|
var opencode_runner_1 = require_opencode_runner();
|
|
14242
14312
|
Object.defineProperty(exports2, "runOpenCodeInit", { enumerable: true, get: function() {
|
|
14243
14313
|
return opencode_runner_1.runOpenCodeInit;
|
|
@@ -14252,6 +14322,13 @@ var require_opencode_integration = __commonJS({
|
|
|
14252
14322
|
Object.defineProperty(exports2, "OpenCodeTaskTracker", { enumerable: true, get: function() {
|
|
14253
14323
|
return task_tracker_1.OpenCodeTaskTracker;
|
|
14254
14324
|
} });
|
|
14325
|
+
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
14326
|
+
Object.defineProperty(exports2, "buildExtensionsJobPayload", { enumerable: true, get: function() {
|
|
14327
|
+
return collect_extensions_created_1.buildExtensionsJobPayload;
|
|
14328
|
+
} });
|
|
14329
|
+
Object.defineProperty(exports2, "collectInsertedExtensionsMetadata", { enumerable: true, get: function() {
|
|
14330
|
+
return collect_extensions_created_1.collectInsertedExtensionsMetadata;
|
|
14331
|
+
} });
|
|
14255
14332
|
}
|
|
14256
14333
|
});
|
|
14257
14334
|
|
|
@@ -19399,6 +19476,7 @@ var require_opencode_init = __commonJS({
|
|
|
19399
19476
|
var logger_12 = require_logger();
|
|
19400
19477
|
var config_12 = require_config();
|
|
19401
19478
|
var git_file_changes_1 = require_git_file_changes();
|
|
19479
|
+
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19402
19480
|
var biEvents_1 = require_biEvents();
|
|
19403
19481
|
var pre_run_decision_1 = require_pre_run_decision();
|
|
19404
19482
|
var environments_12 = require_environments();
|
|
@@ -19454,11 +19532,13 @@ var require_opencode_init = __commonJS({
|
|
|
19454
19532
|
});
|
|
19455
19533
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19456
19534
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19535
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19457
19536
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19458
19537
|
requiredPermissions: result.requiredPermissions,
|
|
19459
19538
|
files,
|
|
19460
19539
|
history,
|
|
19461
|
-
...agentOutput
|
|
19540
|
+
...agentOutput,
|
|
19541
|
+
extensions
|
|
19462
19542
|
});
|
|
19463
19543
|
if (!store.isCompleted) {
|
|
19464
19544
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {});
|
|
@@ -19480,12 +19560,14 @@ var require_opencode_init = __commonJS({
|
|
|
19480
19560
|
const codegenError = (0, ditto_codegen_types_2.toCodegenError)(error);
|
|
19481
19561
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19482
19562
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19563
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19483
19564
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19484
19565
|
requiredPermissions: [],
|
|
19485
19566
|
requiredPermissionsErrors: codegenError,
|
|
19486
19567
|
files,
|
|
19487
19568
|
history,
|
|
19488
|
-
...agentOutput
|
|
19569
|
+
...agentOutput,
|
|
19570
|
+
extensions
|
|
19489
19571
|
});
|
|
19490
19572
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
19491
19573
|
(0, biEvents_1.reportSessionEnd)({
|
|
@@ -19592,6 +19674,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
19592
19674
|
var logger_12 = require_logger();
|
|
19593
19675
|
var config_12 = require_config();
|
|
19594
19676
|
var git_file_changes_1 = require_git_file_changes();
|
|
19677
|
+
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19595
19678
|
var biEvents_1 = require_biEvents();
|
|
19596
19679
|
var hooks_1 = require_hooks();
|
|
19597
19680
|
var runOpencodeIterateFlow = async (chatHistory, agentData) => {
|
|
@@ -19635,10 +19718,12 @@ var require_opencode_iterate = __commonJS({
|
|
|
19635
19718
|
});
|
|
19636
19719
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19637
19720
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19721
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19638
19722
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19639
19723
|
requiredPermissions: result.requiredPermissions,
|
|
19640
19724
|
files,
|
|
19641
|
-
...agentOutput
|
|
19725
|
+
...agentOutput,
|
|
19726
|
+
extensions
|
|
19642
19727
|
});
|
|
19643
19728
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {
|
|
19644
19729
|
taskOutput: { files }
|
|
@@ -19660,11 +19745,13 @@ var require_opencode_iterate = __commonJS({
|
|
|
19660
19745
|
const codegenError = (0, ditto_codegen_types_2.toCodegenError)(error);
|
|
19661
19746
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19662
19747
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19748
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19663
19749
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19664
19750
|
requiredPermissions: [],
|
|
19665
19751
|
requiredPermissionsErrors: codegenError,
|
|
19666
19752
|
files,
|
|
19667
|
-
...agentOutput
|
|
19753
|
+
...agentOutput,
|
|
19754
|
+
extensions
|
|
19668
19755
|
});
|
|
19669
19756
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
19670
19757
|
(0, biEvents_1.reportSessionEnd)({
|
|
@@ -19769,6 +19856,7 @@ var require_opencode_ask = __commonJS({
|
|
|
19769
19856
|
var logger_12 = require_logger();
|
|
19770
19857
|
var config_12 = require_config();
|
|
19771
19858
|
var git_file_changes_1 = require_git_file_changes();
|
|
19859
|
+
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19772
19860
|
var biEvents_1 = require_biEvents();
|
|
19773
19861
|
var runOpencodeAskFlow = async (chatHistory) => {
|
|
19774
19862
|
const store = job_context_storage_12.jobContextStorage.getStore();
|
|
@@ -19808,8 +19896,10 @@ var require_opencode_ask = __commonJS({
|
|
|
19808
19896
|
chatHistory
|
|
19809
19897
|
});
|
|
19810
19898
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19899
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19811
19900
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19812
|
-
files
|
|
19901
|
+
files,
|
|
19902
|
+
extensions
|
|
19813
19903
|
});
|
|
19814
19904
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {
|
|
19815
19905
|
taskOutput: {
|
|
@@ -19829,8 +19919,10 @@ var require_opencode_ask = __commonJS({
|
|
|
19829
19919
|
} catch (error) {
|
|
19830
19920
|
const codegenError = (0, ditto_codegen_types_2.toCodegenError)(error);
|
|
19831
19921
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19922
|
+
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19832
19923
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19833
|
-
files
|
|
19924
|
+
files,
|
|
19925
|
+
extensions
|
|
19834
19926
|
});
|
|
19835
19927
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
19836
19928
|
(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.332",
|
|
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": "afb93089cd6a55134fc2b969f6f956a3fa1e65f0aca41037a5eacc96"
|
|
32
32
|
}
|