@wix/ditto-codegen-public 1.0.349 → 1.0.350
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 +12 -18
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -12572,13 +12572,6 @@ var require_parser = __commonJS({
|
|
|
12572
12572
|
if (filePath) {
|
|
12573
12573
|
addFileChange(filePath, operation);
|
|
12574
12574
|
}
|
|
12575
|
-
if (metadata?.diagnostics) {
|
|
12576
|
-
for (const diagPath of Object.keys(metadata.diagnostics)) {
|
|
12577
|
-
if (diagPath && !diagPath.includes("node_modules")) {
|
|
12578
|
-
addFileChange(diagPath, ditto_codegen_types_12.ExtensionGenerationOperation.INSERT);
|
|
12579
|
-
}
|
|
12580
|
-
}
|
|
12581
|
-
}
|
|
12582
12575
|
}
|
|
12583
12576
|
if (tool === "task" && event.part.state.metadata?.summary) {
|
|
12584
12577
|
for (const item of event.part.state.metadata.summary) {
|
|
@@ -12994,16 +12987,11 @@ var require_result_builder = __commonJS({
|
|
|
12994
12987
|
"dist/opencode-integration/result-builder.js"(exports2) {
|
|
12995
12988
|
"use strict";
|
|
12996
12989
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12997
|
-
exports2.isCorruptedSessionError = isCorruptedSessionError;
|
|
12998
12990
|
exports2.createTimeoutResult = createTimeoutResult;
|
|
12999
12991
|
exports2.createSuccessResult = createSuccessResult;
|
|
13000
12992
|
exports2.createSpawnErrorResult = createSpawnErrorResult;
|
|
13001
12993
|
var ditto_codegen_types_12 = require_dist4();
|
|
13002
12994
|
var parser_1 = require_parser();
|
|
13003
|
-
function isCorruptedSessionError(result) {
|
|
13004
|
-
const combined = `${result.stderr} ${result.stdout} ${result.error?.message || ""}`;
|
|
13005
|
-
return !result.success && combined.includes("tool_use") && combined.includes("tool_result");
|
|
13006
|
-
}
|
|
13007
12995
|
function createTimeoutResult(message, stdout, stderr, startTime) {
|
|
13008
12996
|
return {
|
|
13009
12997
|
success: false,
|
|
@@ -13170,13 +13158,15 @@ var require_executor = __commonJS({
|
|
|
13170
13158
|
let accumulatedUsage = (0, parser_1.createEmptyUsageStats)();
|
|
13171
13159
|
const accumulatedSkills = [];
|
|
13172
13160
|
let currentPrompt = options.prompt;
|
|
13161
|
+
let continueSession = options.continueSession ?? false;
|
|
13173
13162
|
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
|
13174
13163
|
if (attempt > 1) {
|
|
13175
13164
|
logger_12.logger.info(`[OpenCode] Retry attempt ${attempt}/${MAX_RETRIES} - starting fresh session with recovery context`);
|
|
13176
13165
|
const filesChanged = (0, parser_1.parseFilesChanged)(accumulatedStdout);
|
|
13177
13166
|
currentPrompt = (0, prompts_1.buildRecoveryPrompt)(options.prompt, filesChanged, lastResult?.error?.message || lastResult?.stderr || "Process timed out");
|
|
13167
|
+
continueSession = false;
|
|
13178
13168
|
}
|
|
13179
|
-
const result = await executeOpenCodeOnce({ ...options, prompt: currentPrompt }, attempt);
|
|
13169
|
+
const result = await executeOpenCodeOnce({ ...options, prompt: currentPrompt, continueSession }, attempt);
|
|
13180
13170
|
accumulatedStdout += result.stdout;
|
|
13181
13171
|
accumulatedUsage = (0, parser_1.mergeUsageStats)(accumulatedUsage, result.usage);
|
|
13182
13172
|
accumulatedSkills.push(...result.skillsUsed);
|
|
@@ -13224,11 +13214,12 @@ var require_executor = __commonJS({
|
|
|
13224
13214
|
logger_12.logger.debug("[OpenCode] Stats", { stats });
|
|
13225
13215
|
}
|
|
13226
13216
|
}
|
|
13227
|
-
function buildArgs(prompt) {
|
|
13228
|
-
|
|
13217
|
+
function buildArgs(prompt, continueSession) {
|
|
13218
|
+
const sessionArgs = continueSession ? ["--continue"] : [];
|
|
13219
|
+
return ["run", ...sessionArgs, "--format", "json", prompt];
|
|
13229
13220
|
}
|
|
13230
13221
|
async function executeOpenCodeOnce(options, attempt) {
|
|
13231
|
-
const { prompt, outputPath, projectId, onStdout, onStderr } = options;
|
|
13222
|
+
const { prompt, outputPath, projectId, onStdout, onStderr, continueSession = false } = options;
|
|
13232
13223
|
const startTime = Date.now();
|
|
13233
13224
|
const taskTracker = new task_tracker_1.OpenCodeTaskTracker(outputPath);
|
|
13234
13225
|
return new Promise((resolve) => {
|
|
@@ -13260,11 +13251,12 @@ var require_executor = __commonJS({
|
|
|
13260
13251
|
finalize
|
|
13261
13252
|
};
|
|
13262
13253
|
try {
|
|
13263
|
-
const args = buildArgs(prompt);
|
|
13254
|
+
const args = buildArgs(prompt, continueSession);
|
|
13264
13255
|
logger_12.logger.info("[OpenCode] Executing opencode run", {
|
|
13265
13256
|
attempt,
|
|
13266
13257
|
maxRetries: MAX_RETRIES,
|
|
13267
|
-
workingDirectory: outputPath
|
|
13258
|
+
workingDirectory: outputPath,
|
|
13259
|
+
continueSession
|
|
13268
13260
|
});
|
|
13269
13261
|
logger_12.logger.debug("[OpenCode] Full prompt", { prompt });
|
|
13270
13262
|
const isAsk = job_context_storage_12.jobContextStorage.getStore()?.kind === ditto_codegen_types_12.TaskKind.ASK_CODEGEN;
|
|
@@ -13326,6 +13318,7 @@ var require_opencode_runner = __commonJS({
|
|
|
13326
13318
|
prompt,
|
|
13327
13319
|
outputPath,
|
|
13328
13320
|
projectId,
|
|
13321
|
+
continueSession: true,
|
|
13329
13322
|
onStdout,
|
|
13330
13323
|
onStderr
|
|
13331
13324
|
});
|
|
@@ -13337,6 +13330,7 @@ var require_opencode_runner = __commonJS({
|
|
|
13337
13330
|
prompt,
|
|
13338
13331
|
outputPath,
|
|
13339
13332
|
projectId,
|
|
13333
|
+
continueSession: true,
|
|
13340
13334
|
onStdout,
|
|
13341
13335
|
onStderr
|
|
13342
13336
|
});
|
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.350",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"esbuild": "^0.27.2",
|
|
30
30
|
"vitest": "^4.0.16"
|
|
31
31
|
},
|
|
32
|
-
"falconPackageHash": "
|
|
32
|
+
"falconPackageHash": "7b2e53264eacac128859b81385968e6717dcc2aa010583e57495c189"
|
|
33
33
|
}
|