@wix/ditto-codegen-public 1.0.38 → 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 +40 -27
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -119243,6 +119243,7 @@ var require_types_impl2 = __commonJS({
119243
119243
  (function(TenantMode2) {
119244
119244
  TenantMode2["META_SITE"] = "META_SITE";
119245
119245
  TenantMode2["ACCOUNT"] = "ACCOUNT";
119246
+ TenantMode2["APP"] = "APP";
119246
119247
  })(TenantMode = exports2.TenantMode || (exports2.TenantMode = {}));
119247
119248
  var Order;
119248
119249
  (function(Order2) {
@@ -123508,19 +123509,35 @@ ${input.content}
123508
123509
 
123509
123510
  Please provide the complete fixed file content that resolves ALL the errors listed above.`;
123510
123511
  const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-sonnet-4-20250514");
123511
- const result = await (0, ai_1.generateObject)({
123512
- model,
123513
- schema: BatchFixSchema,
123514
- system,
123515
- prompt,
123516
- maxRetries: 2,
123517
- temperature: 0.1,
123518
- experimental_telemetry: {
123519
- isEnabled: true,
123520
- 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.`);
123521
123538
  }
123522
- });
123523
- return result.object;
123539
+ throw error;
123540
+ }
123524
123541
  }
123525
123542
  };
123526
123543
  exports2.default = NaiveFixerAgent;
@@ -125817,7 +125834,7 @@ var require_extensionGenerators = __commonJS({
125817
125834
  throw new Error("No valid scaffolding subpath found for service plugin");
125818
125835
  }
125819
125836
  const source = "./" + path_1.default.join(scaffoldDir, "plugin.ts").replace(/^src\//, "");
125820
- return { source };
125837
+ return { source, name: ext.name };
125821
125838
  }
125822
125839
  static createDashboardPageData(ext, scaffoldDir) {
125823
125840
  const title = ext.name || "My Backoffice Page";
@@ -132536,7 +132553,6 @@ var require_orchestrator = __commonJS({
132536
132553
  super();
132537
132554
  this.agentsFactory = agentsFactory;
132538
132555
  this.apiKey = apiKey;
132539
- this.shouldUseFixAgent = process.env.USE_AUTOFIX === "true";
132540
132556
  }
132541
132557
  // Typed helpers
132542
132558
  onEvent(event, listener) {
@@ -132811,12 +132827,10 @@ var require_orchestrator = __commonJS({
132811
132827
  outputPath,
132812
132828
  durationMs: durationMsCodeGeneration
132813
132829
  });
132814
- if (this.shouldUseFixAgent) {
132815
- await this.startFixFlow({
132816
- projectDir: outputPath,
132817
- apiKey: this.apiKey
132818
- });
132819
- }
132830
+ await this.startFixFlow({
132831
+ projectDir: outputPath,
132832
+ apiKey: this.apiKey
132833
+ });
132820
132834
  const durationMs = Date.now() - start;
132821
132835
  this.emitEvent("finish", { outputPath, durationMs });
132822
132836
  }
@@ -132857,19 +132871,18 @@ var require_orchestrator = __commonJS({
132857
132871
  outputPath,
132858
132872
  durationMs: durationMsCodeGeneration
132859
132873
  });
132860
- if (this.shouldUseFixAgent) {
132861
- await this.startFixFlow({
132862
- projectDir: outputPath,
132863
- apiKey: this.apiKey
132864
- });
132865
- }
132874
+ await this.startFixFlow({
132875
+ projectDir: outputPath,
132876
+ apiKey: this.apiKey
132877
+ });
132866
132878
  const durationMs = Date.now() - start;
132867
132879
  this.emitEvent("finish:iteration", { outputPath, durationMs });
132868
132880
  }
132869
132881
  async startFixFlow(request) {
132870
132882
  const { projectDir, apiKey } = request;
132871
132883
  if (!apiKey) {
132872
- 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;
132873
132886
  }
132874
132887
  this.emitEvent("validation:start", { outputPath: projectDir });
132875
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.38",
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": "54a1561268bef386f7dd6078078063fd54c1a31c6d6a8da708fcc3d9"
27
+ "falconPackageHash": "192058cf04a0057cd06504db0ef576ccedeba8e8ad30868d0b307381"
28
28
  }