@wix/ditto-codegen-public 1.0.166 → 1.0.168

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 +42 -18
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -111496,8 +111496,8 @@ var require_customAnthropicProvider = __commonJS({
111496
111496
  "use strict";
111497
111497
  Object.defineProperty(exports2, "__esModule", { value: true });
111498
111498
  exports2.CustomLanguageModelText = exports2.CustomLanguageModelObject = void 0;
111499
- exports2.createCustomObject = createCustomObject;
111500
- exports2.createCustomText = createCustomText;
111499
+ exports2.createCustomObjectModel = createCustomObjectModel;
111500
+ exports2.createCustomTextModel = createCustomTextModel;
111501
111501
  var CustomLanguageModelObject_1 = require_CustomLanguageModelObject();
111502
111502
  var CustomLanguageModelText_1 = require_CustomLanguageModelText();
111503
111503
  var CustomLanguageModelObject_2 = require_CustomLanguageModelObject();
@@ -111508,13 +111508,13 @@ var require_customAnthropicProvider = __commonJS({
111508
111508
  Object.defineProperty(exports2, "CustomLanguageModelText", { enumerable: true, get: function() {
111509
111509
  return CustomLanguageModelText_2.CustomLanguageModelText;
111510
111510
  } });
111511
- function createCustomObject() {
111511
+ function createCustomObjectModel() {
111512
111512
  const provider = (modelId, settings) => new CustomLanguageModelObject_1.CustomLanguageModelObject(modelId, settings);
111513
111513
  provider.providerId = "custom-object-provider";
111514
111514
  provider.languageModel = provider;
111515
111515
  return provider;
111516
111516
  }
111517
- function createCustomText() {
111517
+ function createCustomTextModel() {
111518
111518
  const provider = (modelId, settings) => new CustomLanguageModelText_1.CustomLanguageModelText(modelId, settings);
111519
111519
  provider.providerId = "custom-text-provider";
111520
111520
  provider.languageModel = provider;
@@ -111854,7 +111854,7 @@ var require_CodegenAIProxyService = __commonJS({
111854
111854
  return aiGenerationResponse;
111855
111855
  };
111856
111856
  this.generateCodegenObject = async (payload) => {
111857
- const custom = (0, customAnthropicProvider_1.createCustomObject)();
111857
+ const custom = (0, customAnthropicProvider_1.createCustomObjectModel)();
111858
111858
  const model = custom(payload.model, { agentName: payload.agentName });
111859
111859
  const response = await (0, ai_1.generateObject)({
111860
111860
  model,
@@ -114534,12 +114534,27 @@ Given the full chat history, current user request, and all project files:
114534
114534
  * You want to check their configuration
114535
114535
  * They are related but don't need modification
114536
114536
  - **DEFAULT TO MODIFYING EXISTING EXTENSIONS** - Always prefer updating existing extensions over creating new ones
114537
+ - **AVOID DUPLICATING THE SAME EXTENSION** - Be careful about creating duplicates:
114538
+ * If "Relevant Existing Extensions" shows an extension that can handle the request, modify it in currentExtensions
114539
+ * Don't create a new extension to do the exact same thing as an existing one
114540
+ * HOWEVER: If the user uses keywords like "new", "create", "add", "another" with an extension type, CREATE it in additionalExtensions
114541
+ - **DETECTING NEW EXTENSION REQUESTS - Look for these KEYWORDS:**
114542
+ * "a new [extension type]" \u2192 CREATE new extension in additionalExtensions
114543
+ * "create a [extension type]" \u2192 CREATE new extension in additionalExtensions
114544
+ * "add a [extension type]" \u2192 CREATE new extension in additionalExtensions
114545
+ * "another [extension type]" \u2192 CREATE new extension in additionalExtensions
114546
+ * If user mentions "new" or "create" or "add" before an extension type, they want a NEW separate one
114547
+ * Even if purpose seems similar to existing, if they say "new/create/add", honor that request
114548
+ - **Examples:**
114549
+ * "add animation duration" + existing dashboard \u2192 modify existing dashboard ONLY
114550
+ * "add animation duration AND a new dashboard" \u2192 modify existing + create NEW dashboard
114551
+ * "add animation duration AND create a dashboard" \u2192 modify existing + create NEW dashboard
114552
+ * "add X, and a new dashboard page to manage Y" \u2192 modify existing (if applicable) + create NEW dashboard (user said "new")
114537
114553
  - **Only create new extensions (additionalExtensions) when:**
114538
- 1. The user EXPLICITLY asks to CREATE/ADD something entirely new
114539
- 2. The functionality does NOT exist in any current extension
114540
- 3. No existing extension can be modified to fulfill the request
114541
- - **If an extension already exists that does similar things, MODIFY IT instead of creating a new one**
114542
- - **When in doubt, use currentExtensions to modify existing code, NOT additionalExtensions**
114554
+ 1. The user EXPLICITLY uses keywords "new", "create", "add", or "another" before an extension type
114555
+ 2. OR: The functionality truly does NOT exist in any current extension
114556
+ - **If an extension already exists AND user doesn't use "new/create/add" keywords, MODIFY IT instead**
114557
+ - **When in doubt about "new" keyword presence, FAVOR CREATING the new extension - missing user intent is worse than creating extra**
114543
114558
 
114544
114559
  **IMPORTANT**: Before deciding on extensions, check if this is a data-only operation (handled by PlannerAgent). See common scenarios below.
114545
114560
 
@@ -114584,12 +114599,21 @@ ${(0, codegen_common_logic_1.getExtensionDecisionMatrix)()}`;
114584
114599
  exports2.iterationAgentCommonUseCasesGuide = iterationAgentCommonUseCasesGuideConst;
114585
114600
  exports2.iterationAgentChatHistoryContext = (0, iterationScenarios_1.getChatHistoryContext)();
114586
114601
  exports2.iterationAgentExtensionSelectionLogic = iterationAgentExtensionSelectionLogicConst;
114587
- var getIterationAgentConstraints = (supportedTypes) => `- **CRITICAL - AVOID CREATING NEW EXTENSIONS**: Only propose additionalExtensions if existing ones CANNOT fulfill the user's request. Review "Relevant Existing Extensions" carefully. If similar functionality exists, MODIFY it instead of creating new.
114602
+ var getIterationAgentConstraints = (supportedTypes) => `- **CRITICAL - AVOID UNNECESSARY DUPLICATION**: Only propose additionalExtensions if existing ones CANNOT fulfill the user's request. Review "Relevant Existing Extensions" carefully. If an existing extension can handle the request, MODIFY it instead of creating new.
114603
+ - **SMART DUPLICATION DETECTION**: When deciding between modifying vs creating:
114604
+ * If user says "add X feature" and an extension exists that handles X \u2192 modify the existing extension in currentExtensions
114605
+ * If user says "add X AND create a new Y" where Y is explicitly requested as NEW \u2192 modify existing for X + create new for Y in additionalExtensions
114606
+ * Same extension TYPE can appear in both currentExtensions and additionalExtensions if they serve DIFFERENT purposes
114607
+ * Example: "add animation field" (existing dashboard) \u2192 modify only
114608
+ * Example: "add animation field AND create new dashboard for analytics" \u2192 modify existing + create new
114588
114609
  - **STRONG DEFAULT**: Assume you should use currentExtensions (modify existing) unless there's a clear reason to create something entirely new
114589
- - **additionalExtensions ONLY WHEN**: The user explicitly asks to "create", "add", or "build" something that doesn't exist at all in the current project
114610
+ - **additionalExtensions WHEN**:
114611
+ 1. The user explicitly asks to "create", "add", or "build" something new (look for keywords like "new", "create", "add")
114612
+ 2. The new functionality serves a DIFFERENT purpose than existing extensions (even if same type)
114613
+ 3. No single existing extension can be modified to fulfill the entire request
114590
114614
  - Be specific about which file paths are relevant for each current extension (all extension types)
114591
114615
  - Consider the full chat history context when making decisions
114592
- - **PRIORITIZE REUSING EXISTING EXTENSIONS** over creating new ones - this is a hard requirement, not a suggestion
114616
+ - **PRIORITIZE REUSING EXISTING EXTENSIONS** over creating new ones when the purpose is the same
114593
114617
  - **SUPPORTED EXTENSION TYPES ONLY**: ${supportedTypes}
114594
114618
  - **IMPORTANT**: The "relatedSpis" field is ONLY for SERVICE_PLUGIN extensions - specify the SPI types
114595
114619
  - The "paths" field is for ALL extension types - specify relevant file paths to modify
@@ -114602,14 +114626,14 @@ ${(0, codegen_common_logic_1.getExtensionDecisionMatrix)()}`;
114602
114626
  * Referenced for information but don't need changes
114603
114627
  * Checked for correctness but remain unchanged
114604
114628
  * This is your DEFAULT choice for most requests unless the user explicitly wants something entirely new
114605
- - **ADDITIONAL EXTENSIONS**: ONLY use when the user explicitly asks to CREATE/ADD entirely new functionality that has no existing equivalent. Do NOT use if you can modify existing extensions.
114629
+ - **ADDITIONAL EXTENSIONS**: Use when user explicitly asks to CREATE/ADD new functionality with a different purpose. CAN be the same type as extensions in currentExtensions if they serve different purposes.
114606
114630
  - For currentExtensions, ensure relevantUserRequest precisely reflects the change to be applied in those files (e.g., "Update static fee from 5 ILS to 10 ILS"), not a generic description
114607
114631
  - For additionalExtensions, ensure relevantUserRequest describes the new functionality being created (e.g., "Add new 10 ILS static fee calculator")
114608
- - **KEY RULE - MODIFICATION FIRST**: Default to currentExtensions (modify existing). Only use additionalExtensions when the user's request is explicitly to CREATE something that has NO existing equivalent.
114632
+ - **KEY RULE - MODIFICATION FIRST**: Default to currentExtensions (modify existing). Only use additionalExtensions when the user's request explicitly includes creating NEW functionality with a different purpose.
114609
114633
  - **CRITICAL - EXTENSION-SPECIFIC DESCRIPTIONS**: The relevantUserRequest field becomes the extension's description and is passed directly to individual agents. Each agent ONLY sees its own extension - they don't have context about other extensions, the broader user request, or duplicate issues. Focus on WHAT THIS SPECIFIC EXTENSION should do, not WHY or how it relates to other extensions. Do not reference other extensions.`;
114610
114634
  exports2.getIterationAgentConstraints = getIterationAgentConstraints;
114611
114635
  var getIterationAgentKeyPoints = (supportedTypes) => `- currentExtensions: Existing extensions that need to be MODIFIED (use extensionType from: ${supportedTypes}) - **THIS IS YOUR DEFAULT CHOICE**
114612
- - additionalExtensions: New extensions that need to be CREATED (use extensionType from: ${supportedTypes}) - **ONLY USE IF USER EXPLICITLY ASKS TO CREATE SOMETHING NEW**
114636
+ - additionalExtensions: New extensions that need to be CREATED (use extensionType from: ${supportedTypes}) - **USE WHEN USER EXPLICITLY ASKS TO CREATE SOMETHING NEW WITH A DIFFERENT PURPOSE**
114613
114637
  - summary: Brief summary combining the chat history and current user request
114614
114638
  - "name" field: REQUIRED for ALL extensions - provide a descriptive name for the extension
114615
114639
  - "relatedSpis" field: ONLY for SERVICE_PLUGIN extensions - specify the SPI name
@@ -143852,7 +143876,7 @@ ${(0, extensionFormatters_1.formatScannedExtensions)(extensions, outputPath)}`);
143852
143876
  async generate({ outputPath, extensions, chatHistory, currentUserRequest, previousResources }) {
143853
143877
  const srcStructure = this.generateSrcFolderStructure(outputPath);
143854
143878
  try {
143855
- const model = (0, customAnthropicProvider_1.createCustomText)()(constants_1.LLM_MODELS.CLAUDE_3_5_HAIKU_LATEST, {
143879
+ const model = (0, customAnthropicProvider_1.createCustomTextModel)()(constants_1.LLM_MODELS.CLAUDE_3_5_HAIKU_LATEST, {
143856
143880
  agentName: this.name
143857
143881
  });
143858
143882
  const userContent = this.buildUserPrompt({
@@ -144101,7 +144125,7 @@ var require_SDKPickerAgent = __commonJS({
144101
144125
  const userMessage = this.buildUserPrompt({ iterationPlan, outputPath });
144102
144126
  const systemPrompt = this.buildSystemPrompt({ apiDocsStructure });
144103
144127
  try {
144104
- const model = (0, customAnthropicProvider_1.createCustomText)()(constants_1.LLM_MODELS.CLAUDE_3_5_HAIKU_LATEST, {
144128
+ const model = (0, customAnthropicProvider_1.createCustomTextModel)()(constants_1.LLM_MODELS.CLAUDE_3_5_HAIKU_LATEST, {
144105
144129
  agentName: this.name
144106
144130
  });
144107
144131
  const result = await (0, ai_1.generateText)({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.166",
3
+ "version": "1.0.168",
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": "f4fa79a226dd76d71e7123b20e0cc77f46c96764501c9af43a76a455"
27
+ "falconPackageHash": "5ae3d5626fa246fabbcb4e515fb3e8a1ace523086d84e6afc0d0b7ce"
28
28
  }