@wix/ditto-codegen-public 1.0.39 → 1.0.40

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 +39 -27
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -123509,19 +123509,35 @@ ${input.content}
123509
123509
 
123510
123510
  Please provide the complete fixed file content that resolves ALL the errors listed above.`;
123511
123511
  const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-sonnet-4-20250514");
123512
- const result = await (0, ai_1.generateObject)({
123513
- model,
123514
- schema: BatchFixSchema,
123515
- system,
123516
- prompt,
123517
- maxRetries: 2,
123518
- temperature: 0.1,
123519
- experimental_telemetry: {
123520
- isEnabled: true,
123521
- functionId: "BatchFixAgent"
123512
+ try {
123513
+ const result = await (0, ai_1.generateObject)({
123514
+ model,
123515
+ schema: BatchFixSchema,
123516
+ system,
123517
+ prompt,
123518
+ maxRetries: 2,
123519
+ temperature: 0.1,
123520
+ maxOutputTokens: 16384,
123521
+ // Increased from default 4096 to handle large files
123522
+ experimental_telemetry: {
123523
+ isEnabled: true,
123524
+ functionId: "BatchFixAgent"
123525
+ }
123526
+ });
123527
+ return result.object;
123528
+ } catch (error) {
123529
+ const isTokenLimitError = error.response?.body?.stop_reason === "max_tokens" || error.finishReason === "length" || error.cause?.response?.body?.stop_reason === "max_tokens";
123530
+ if (isTokenLimitError) {
123531
+ const fileSize = Math.round(input.content.length / 1024);
123532
+ const errorCount = input.errors.length;
123533
+ throw new Error(`\u{1F6AB} MAX TOKENS EXCEEDED: File too large for AI to fix automatically
123534
+ File: ${input.filePath}
123535
+ Size: ${fileSize}KB, Errors: ${errorCount}
123536
+ The file is too large for the AI to fix in one attempt.
123537
+ Please fix the errors manually using your code editor.`);
123522
123538
  }
123523
- });
123524
- return result.object;
123539
+ throw error;
123540
+ }
123525
123541
  }
123526
123542
  };
123527
123543
  exports2.default = NaiveFixerAgent;
@@ -125818,7 +125834,7 @@ var require_extensionGenerators = __commonJS({
125818
125834
  throw new Error("No valid scaffolding subpath found for service plugin");
125819
125835
  }
125820
125836
  const source = "./" + path_1.default.join(scaffoldDir, "plugin.ts").replace(/^src\//, "");
125821
- return { source };
125837
+ return { source, name: ext.name };
125822
125838
  }
125823
125839
  static createDashboardPageData(ext, scaffoldDir) {
125824
125840
  const title = ext.name || "My Backoffice Page";
@@ -132537,7 +132553,6 @@ var require_orchestrator = __commonJS({
132537
132553
  super();
132538
132554
  this.agentsFactory = agentsFactory;
132539
132555
  this.apiKey = apiKey;
132540
- this.shouldUseFixAgent = process.env.USE_AUTOFIX === "true";
132541
132556
  }
132542
132557
  // Typed helpers
132543
132558
  onEvent(event, listener) {
@@ -132812,12 +132827,10 @@ var require_orchestrator = __commonJS({
132812
132827
  outputPath,
132813
132828
  durationMs: durationMsCodeGeneration
132814
132829
  });
132815
- if (this.shouldUseFixAgent) {
132816
- await this.startFixFlow({
132817
- projectDir: outputPath,
132818
- apiKey: this.apiKey
132819
- });
132820
- }
132830
+ await this.startFixFlow({
132831
+ projectDir: outputPath,
132832
+ apiKey: this.apiKey
132833
+ });
132821
132834
  const durationMs = Date.now() - start;
132822
132835
  this.emitEvent("finish", { outputPath, durationMs });
132823
132836
  }
@@ -132858,19 +132871,18 @@ var require_orchestrator = __commonJS({
132858
132871
  outputPath,
132859
132872
  durationMs: durationMsCodeGeneration
132860
132873
  });
132861
- if (this.shouldUseFixAgent) {
132862
- await this.startFixFlow({
132863
- projectDir: outputPath,
132864
- apiKey: this.apiKey
132865
- });
132866
- }
132874
+ await this.startFixFlow({
132875
+ projectDir: outputPath,
132876
+ apiKey: this.apiKey
132877
+ });
132867
132878
  const durationMs = Date.now() - start;
132868
132879
  this.emitEvent("finish:iteration", { outputPath, durationMs });
132869
132880
  }
132870
132881
  async startFixFlow(request) {
132871
132882
  const { projectDir, apiKey } = request;
132872
132883
  if (!apiKey) {
132873
- throw new Error("\u26A0\uFE0F No API key provided for fix flow - fixes may be limited");
132884
+ console.warn("\u26A0\uFE0F No API key provided for fix flow - skipping automatic fixes");
132885
+ return;
132874
132886
  }
132875
132887
  this.emitEvent("validation:start", { outputPath: projectDir });
132876
132888
  const fixerFactory = new FixerFactory_1.default(apiKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -24,5 +24,5 @@
24
24
  "@wix/ditto-codegen": "1.0.0",
25
25
  "esbuild": "^0.25.9"
26
26
  },
27
- "falconPackageHash": "d152b870db1075d74529a5231fcd29ddbfc5d477ac3d67c0f79361ff"
27
+ "falconPackageHash": "192058cf04a0057cd06504db0ef576ccedeba8e8ad30868d0b307381"
28
28
  }