@wix/ditto-codegen-public 1.0.191 → 1.0.192

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 +35 -3
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -36576,6 +36576,7 @@ var require_CodegenAIProxyService = __commonJS({
36576
36576
  isEnabled: true,
36577
36577
  functionId: payload.agentName
36578
36578
  },
36579
+ ...payload.experimental_repairText ? { experimental_repairText: payload.experimental_repairText } : {},
36579
36580
  maxOutputTokens: 1e4,
36580
36581
  maxRetries: 3,
36581
36582
  temperature: 0
@@ -72986,6 +72987,7 @@ var require_IterationAgent = __commonJS({
72986
72987
  Object.defineProperty(exports2, "__esModule", { value: true });
72987
72988
  exports2.IterationAgent = void 0;
72988
72989
  var zod_1 = require_zod();
72990
+ var ai_1 = require_dist8();
72989
72991
  var iteration_agent_prompt_1 = require_iteration_agent_prompt();
72990
72992
  var AgentsRegistry_1 = require_AgentsRegistry();
72991
72993
  var codegen_common_logic_1 = require_dist9();
@@ -72994,16 +72996,17 @@ var require_IterationAgent = __commonJS({
72994
72996
  var codeGenerationService_12 = require_codeGenerationService();
72995
72997
  var extensionFormatters_1 = require_extensionFormatters();
72996
72998
  var contextBuilders_1 = require_contextBuilders();
72999
+ var MAX_NAME_LENGTH = 30;
72997
73000
  var CurrentExtensionSchema = zod_1.z.object({
72998
73001
  extensionType: zod_1.z.enum(codegen_common_logic_1.codeGenerationExtensionTypes).describe("The extension kind to trigger"),
72999
- name: zod_1.z.string().min(2).describe("Short, human-readable name for the extension. Less than 30 chars."),
73002
+ name: zod_1.z.string().min(2).max(MAX_NAME_LENGTH).describe(`Short, human-readable name for the extension. Less than ${MAX_NAME_LENGTH} chars.`),
73000
73003
  relatedSpis: zod_1.z.array(zod_1.z.string()).optional().describe("Optional value, only for SPI extensions - specify the SPI types"),
73001
73004
  paths: zod_1.z.array(zod_1.z.string()).describe("Paths relevant for this extension"),
73002
73005
  relevantUserRequest: zod_1.z.string().describe("What part of the user request this extension should do, do not reference other extensions.")
73003
73006
  });
73004
73007
  var AdditionalExtensionSchema = zod_1.z.object({
73005
73008
  extensionType: zod_1.z.enum(codegen_common_logic_1.codeGenerationExtensionTypes).describe("The extension kind to add"),
73006
- name: zod_1.z.string().min(2).max(30).describe("Short, human-readable name for the extension. Less than 30 chars."),
73009
+ name: zod_1.z.string().min(2).max(MAX_NAME_LENGTH).describe(`Short, human-readable name for the extension. Less than ${MAX_NAME_LENGTH} chars.`),
73007
73010
  relatedSpis: zod_1.z.array(zod_1.z.string()).optional().describe("Optional value, only for SPI extensions - specify the SPI types"),
73008
73011
  relevantUserRequest: zod_1.z.string().describe("What part of the user request this extension should do, do not reference other extensions.")
73009
73012
  });
@@ -73040,6 +73043,34 @@ var require_IterationAgent = __commonJS({
73040
73043
  })) || []
73041
73044
  };
73042
73045
  }
73046
+ async repairNameTooLong({ text, error }) {
73047
+ if (!ai_1.TypeValidationError.isInstance(error)) {
73048
+ return text;
73049
+ }
73050
+ const cause = error.cause;
73051
+ const hasNameTooLongIssue = cause?.issues?.some((issue) => issue.code === "too_big" && issue.path?.at(-1) === "name");
73052
+ if (!hasNameTooLongIssue) {
73053
+ return text;
73054
+ }
73055
+ const parsed = JSON.parse(text);
73056
+ const hasCurrentExtensionsIssue = parsed.currentExtensions && cause?.issues?.some((issue) => issue.path?.includes("currentExtensions"));
73057
+ const hasAdditionalExtensionsIssue = parsed.additionalExtensions && cause?.issues?.some((issue) => issue.path?.includes("additionalExtensions"));
73058
+ if (hasCurrentExtensionsIssue) {
73059
+ for (const ext of parsed.currentExtensions) {
73060
+ if (ext.name && ext.name.length > MAX_NAME_LENGTH) {
73061
+ ext.name = ext.name.slice(0, MAX_NAME_LENGTH);
73062
+ }
73063
+ }
73064
+ }
73065
+ if (hasAdditionalExtensionsIssue) {
73066
+ for (const ext of parsed.additionalExtensions) {
73067
+ if (ext.name && ext.name.length > MAX_NAME_LENGTH) {
73068
+ ext.name = ext.name.slice(0, MAX_NAME_LENGTH);
73069
+ }
73070
+ }
73071
+ }
73072
+ return JSON.stringify(parsed);
73073
+ }
73043
73074
  buildUserPrompt({ chatHistory, currentUserRequest, previousResources, extensionSelectorResult }) {
73044
73075
  const sections = (0, contextBuilders_1.buildContextSections)(chatHistory, currentUserRequest, previousResources);
73045
73076
  sections.push(`
@@ -73063,7 +73094,8 @@ ${(0, extensionFormatters_1.formatContextExtensions)(extensionSelectorResult.con
73063
73094
  provider: constants_1.LLM_PROVIDERS.ANTHROPIC,
73064
73095
  model: constants_1.LLM_MODELS.CLAUDE_3_5_HAIKU_LATEST,
73065
73096
  schema: IterationPlanSchema,
73066
- agentName: this.name
73097
+ agentName: this.name,
73098
+ experimental_repairText: this.repairNameTooLong
73067
73099
  });
73068
73100
  const resultObject = {
73069
73101
  currentExtensions: result.object.currentExtensions.map((ext) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.191",
3
+ "version": "1.0.192",
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": "5b67b19500c5227d223ef15b69d91c8c965fbd2aa2cabee9f5ac410a"
27
+ "falconPackageHash": "63e456b352799d738ee7c3c7beebe3b1adb2c0db877a801ef24a15f4"
28
28
  }