@wix/ditto-codegen-public 1.0.280 → 1.0.282

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 +53 -19
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -12072,6 +12072,7 @@ var require_parser = __commonJS({
12072
12072
  exports2.createEmptyUsageStats = createEmptyUsageStats;
12073
12073
  exports2.parseUsageStats = parseUsageStats;
12074
12074
  exports2.mergeUsageStats = mergeUsageStats;
12075
+ exports2.hasSessionError = hasSessionError;
12075
12076
  exports2.formatUsageStats = formatUsageStats;
12076
12077
  var ditto_codegen_types_12 = require_dist4();
12077
12078
  var types_1 = require_types4();
@@ -12199,6 +12200,32 @@ var require_parser = __commonJS({
12199
12200
  stepCount: a.stepCount + b.stepCount
12200
12201
  };
12201
12202
  }
12203
+ function hasSessionError(output) {
12204
+ const lines = output.split("\n");
12205
+ let foundError = false;
12206
+ let lastStepFinishReason;
12207
+ for (const line of lines) {
12208
+ if (!line.trim())
12209
+ continue;
12210
+ const event = (0, types_1.tryParseJson)(line);
12211
+ if (!event)
12212
+ continue;
12213
+ if (event.type === "error") {
12214
+ foundError = true;
12215
+ } else if (event.type === "tool_use") {
12216
+ const toolEvent = event;
12217
+ if (toolEvent.part?.state?.status === "error") {
12218
+ foundError = true;
12219
+ }
12220
+ } else if (event.type === "step_finish") {
12221
+ const stepEvent = event;
12222
+ lastStepFinishReason = stepEvent.part?.reason;
12223
+ }
12224
+ }
12225
+ if (lastStepFinishReason === "stop")
12226
+ return false;
12227
+ return foundError;
12228
+ }
12202
12229
  function formatUsageStats(stats) {
12203
12230
  const lines = [
12204
12231
  `\u{1F4CA} Usage Summary:`,
@@ -12816,8 +12843,10 @@ var require_executor = __commonJS({
12816
12843
  accumulatedSkills.push(...result.skillsUsed);
12817
12844
  accumulatedExtensions.push(...result.extensionsCreated);
12818
12845
  const errorMsg = result.error?.message.toLowerCase() ?? "";
12819
- const isRetryableFailure = !result.success && errorMsg.includes("idle timeout");
12820
- if (result.success || !isRetryableFailure) {
12846
+ const isIdleTimeout = !result.success && errorMsg.includes("idle timeout");
12847
+ const isSessionError = (0, parser_1.hasSessionError)(result.stdout);
12848
+ const isRetryableFailure = isIdleTimeout || isSessionError;
12849
+ if (!isRetryableFailure) {
12821
12850
  const finalResult2 = {
12822
12851
  ...result,
12823
12852
  filesChanged: (0, parser_1.parseFilesChanged)(accumulatedStdout),
@@ -12830,7 +12859,8 @@ var require_executor = __commonJS({
12830
12859
  return finalResult2;
12831
12860
  }
12832
12861
  lastResult = result;
12833
- logger_12.logger.warn("[OpenCode] Attempt failed due to idle timeout, will retry", {
12862
+ const reason = isSessionError ? "session error" : "idle timeout";
12863
+ logger_12.logger.warn(`[OpenCode] Attempt failed due to ${reason}, will retry`, {
12834
12864
  attempt,
12835
12865
  maxRetries: MAX_RETRIES
12836
12866
  });
@@ -18130,14 +18160,33 @@ var require_skills_installer = __commonJS({
18130
18160
  var util_1 = require("util");
18131
18161
  var ditto_codegen_types_12 = require_dist4();
18132
18162
  var execAsync = (0, util_1.promisify)(child_process_1.exec);
18163
+ var SKILLS_DIR = "/root/.agents/skills";
18133
18164
  var SKILLS_INSTALL_COMMAND = "npx --yes skills add wix/skills -g -a opencode -y";
18134
18165
  function buildOverrideCommand(branch) {
18135
- return `curl -sL https://github.com/wix/skills/archive/${branch}.tar.gz | tar xz --strip-components=2 -C /root/.agents/skills --wildcards "*/skills/*"`;
18166
+ return `rm -rf ${SKILLS_DIR} && mkdir -p ${SKILLS_DIR} && curl -sL https://github.com/wix/skills/archive/${branch}.tar.gz | tar xz --strip-components=2 -C ${SKILLS_DIR} --wildcards "*/skills/*"`;
18136
18167
  }
18137
18168
  async function installSkills(outputPath, log) {
18138
18169
  log.info("[Skills] Installing Wix skills globally", {
18139
18170
  installInternalSkills: process.env.INSTALL_INTERNAL_SKILLS
18140
18171
  });
18172
+ const overrideBranch = process.env.SKILLS_OVERRIDE_BRANCH;
18173
+ if (overrideBranch) {
18174
+ try {
18175
+ log.info("[Skills] Installing skills from branch", {
18176
+ branch: overrideBranch
18177
+ });
18178
+ await execAsync(buildOverrideCommand(overrideBranch), {
18179
+ cwd: outputPath
18180
+ });
18181
+ log.info("[Skills] Skills installed from branch successfully");
18182
+ return;
18183
+ } catch (error) {
18184
+ const errorMessage = error instanceof Error ? error.message : String(error);
18185
+ log.warn("[Skills] Branch install failed, falling back to default", {
18186
+ error: errorMessage
18187
+ });
18188
+ }
18189
+ }
18141
18190
  try {
18142
18191
  const { stdout, stderr } = await execAsync(SKILLS_INSTALL_COMMAND, {
18143
18192
  cwd: outputPath
@@ -18154,21 +18203,6 @@ var require_skills_installer = __commonJS({
18154
18203
  cause: error
18155
18204
  });
18156
18205
  }
18157
- const overrideBranch = process.env.SKILLS_OVERRIDE_BRANCH;
18158
- if (!overrideBranch)
18159
- return;
18160
- try {
18161
- log.info("[Skills] Overriding skills from branch", {
18162
- branch: overrideBranch
18163
- });
18164
- await execAsync(buildOverrideCommand(overrideBranch), { cwd: outputPath });
18165
- log.info("[Skills] Skills override complete");
18166
- } catch (error) {
18167
- const errorMessage = error instanceof Error ? error.message : String(error);
18168
- log.warn("[Skills] Skills override failed, using default", {
18169
- error: errorMessage
18170
- });
18171
- }
18172
18206
  }
18173
18207
  }
18174
18208
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.280",
3
+ "version": "1.0.282",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -27,5 +27,5 @@
27
27
  "@wix/ditto-codegen": "1.0.0",
28
28
  "esbuild": "^0.27.2"
29
29
  },
30
- "falconPackageHash": "70edf61cffcb5b7f839c64fa0f2aad237cbee615f556014d88d77f80"
30
+ "falconPackageHash": "dfa51d2033ad05b1debde0dbd9a4970eab5e3a9a5507fc31abbf2a36"
31
31
  }