@wix/ditto-codegen-public 1.0.196 → 1.0.197

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 +260 -13
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -39863,33 +39863,57 @@ Given the full chat history, current user request, and all project files:
39863
39863
  4. Propose new extensions that need to be CREATED for functionality not covered by existing ones (additionalExtensions)
39864
39864
 
39865
39865
  **CRITICAL RULES:**
39866
- - **ONLY RETURN EXTENSIONS THAT NEED CODE CHANGES** - Do NOT return extensions just because:
39866
+
39867
+ **#1 - ONLY CREATE WHAT THE USER EXPLICITLY ASKS FOR:**
39868
+ - **DO NOT ADD EXTRA EXTENSIONS** that the user did not request
39869
+ - If the user asks for a specific extension type, create ONLY that extension type
39870
+ - Do NOT add "helper" extensions, "management" dashboards, or "companion" extensions unless explicitly requested
39871
+ - Respect the user's intent - if they want a simple widget, give them a simple widget, not a widget + dashboard + backend
39872
+ - **EXCEPTION**: If the user's request CANNOT work without an additional extension (technical requirement), then add it
39873
+
39874
+ **#2 - ONLY RETURN EXTENSIONS THAT NEED CODE CHANGES** - Do NOT return extensions just because:
39867
39875
  * You need to verify or validate against them
39868
39876
  * They contain information you need to reference
39869
39877
  * You want to check their configuration
39870
39878
  * They are related but don't need modification
39871
- - **DEFAULT TO MODIFYING EXISTING EXTENSIONS** - Always prefer updating existing extensions over creating new ones
39872
- - **AVOID DUPLICATING THE SAME EXTENSION** - Be careful about creating duplicates:
39879
+
39880
+ **#3 - DEFAULT TO MODIFYING EXISTING EXTENSIONS** - Always prefer updating existing extensions over creating new ones
39881
+
39882
+ **#4 - AVOID DUPLICATING THE SAME EXTENSION** - Be careful about creating duplicates:
39873
39883
  * If "Relevant Existing Extensions" shows an extension that can handle the request, modify it in currentExtensions
39874
39884
  * Don't create a new extension to do the exact same thing as an existing one
39875
39885
  * HOWEVER: If the user uses keywords like "new", "create", "add", "another" with an extension type, CREATE it in additionalExtensions
39876
- - **DETECTING NEW EXTENSION REQUESTS - Look for these KEYWORDS:**
39886
+
39887
+ **#5 - DETECTING NEW EXTENSION REQUESTS - Look for these KEYWORDS:**
39877
39888
  * "a new [extension type]" \u2192 CREATE new extension in additionalExtensions
39878
39889
  * "create a [extension type]" \u2192 CREATE new extension in additionalExtensions
39879
39890
  * "add a [extension type]" \u2192 CREATE new extension in additionalExtensions
39880
39891
  * "another [extension type]" \u2192 CREATE new extension in additionalExtensions
39881
39892
  * If user mentions "new" or "create" or "add" before an extension type, they want a NEW separate one
39882
39893
  * Even if purpose seems similar to existing, if they say "new/create/add", honor that request
39883
- - **Examples:**
39894
+
39895
+ **Examples:**
39884
39896
  * "add animation duration" + existing dashboard \u2192 modify existing dashboard ONLY
39885
39897
  * "add animation duration AND a new dashboard" \u2192 modify existing + create NEW dashboard
39886
39898
  * "add animation duration AND create a dashboard" \u2192 modify existing + create NEW dashboard
39887
39899
  * "add X, and a new dashboard page to manage Y" \u2192 modify existing (if applicable) + create NEW dashboard (user said "new")
39888
- - **Only create new extensions (additionalExtensions) when:**
39900
+ * "create a widget that shows countdown" \u2192 create ONLY the widget, do NOT add dashboard unless requested
39901
+
39902
+ **#6 - Only create new extensions (additionalExtensions) when:**
39889
39903
  1. The user EXPLICITLY uses keywords "new", "create", "add", or "another" before an extension type
39890
39904
  2. OR: The functionality truly does NOT exist in any current extension
39891
- - **If an extension already exists AND user doesn't use "new/create/add" keywords, MODIFY IT instead**
39892
- - **When in doubt about "new" keyword presence, FAVOR CREATING the new extension - missing user intent is worse than creating extra**
39905
+ 3. AND: The user actually requested that type of functionality
39906
+
39907
+ **#7 - If an extension already exists AND user doesn't use "new/create/add" keywords, MODIFY IT instead**
39908
+
39909
+ **EXTENSION TYPE RULES & USAGE NOTES:**
39910
+ - Use **SITE_COMPONENT** ONLY when React is EXPLICITLY requested by the user. If React is not explicitly mentioned, use **SITE_WIDGET** instead.
39911
+ - Use **DASHBOARD_PAGE** for admin tasks and configuration - but ONLY if the user requests admin/management capabilities.
39912
+ - Use **SERVICE_PLUGIN** for platform-level logic (tax/shipping/pricing/validation) - match SPI use cases to appropriate plugin types.
39913
+ - If the user prompt contains trigger patterns like "when", "after", "automatically when", or "trigger on [event]", include a **BACKEND_EVENT** extension.
39914
+ - **Backend API (HTTP Endpoints)**: Suggest them ONLY when the user prompt EXPLICITLY requests a backend, a server, or an endpoint.
39915
+ - **EMBEDDED_SCRIPT + DASHBOARD_PAGE**: MANDATORY - Every EMBEDDED_SCRIPT MUST be paired with at least one DASHBOARD_PAGE to manage configuration. This is a technical requirement, not optional.
39916
+ - **SITE_WIDGET does NOT need DASHBOARD_PAGE**: Site Widgets have a built-in settings panel in the Wix Editor. Do NOT add Dashboard Page unless user EXPLICITLY requests centralized/shared database configuration.
39893
39917
 
39894
39918
  **IMPORTANT**: Before deciding on extensions, check if this is a data-only operation (handled by PlannerAgent). See common scenarios below.
39895
39919
 
@@ -39934,7 +39958,8 @@ ${(0, codegen_common_logic_1.getExtensionDecisionMatrix)()}`;
39934
39958
  exports2.iterationAgentCommonUseCasesGuide = iterationAgentCommonUseCasesGuideConst;
39935
39959
  exports2.iterationAgentChatHistoryContext = (0, iterationScenarios_1.getChatHistoryContext)();
39936
39960
  exports2.iterationAgentExtensionSelectionLogic = iterationAgentExtensionSelectionLogicConst;
39937
- 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.
39961
+ var getIterationAgentConstraints = (supportedTypes) => `- **CRITICAL - ONLY CREATE WHAT USER EXPLICITLY REQUESTS**: Do NOT add extra extensions the user didn't ask for. If user asks for a widget, create only the widget. If user asks for a dashboard, create only the dashboard. Do not assume they need "helper" or "management" extensions.
39962
+ - **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.
39938
39963
  - **SMART DUPLICATION DETECTION**: When deciding between modifying vs creating:
39939
39964
  * If user says "add X feature" and an extension exists that handles X \u2192 modify the existing extension in currentExtensions
39940
39965
  * 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
@@ -73062,6 +73087,227 @@ var require_AgentsRegistry = __commonJS({
73062
73087
  }
73063
73088
  });
73064
73089
 
73090
+ // dist/system-prompts/iterationAgent/iteration-examples.js
73091
+ var require_iteration_examples = __commonJS({
73092
+ "dist/system-prompts/iterationAgent/iteration-examples.js"(exports2) {
73093
+ "use strict";
73094
+ Object.defineProperty(exports2, "__esModule", { value: true });
73095
+ exports2.iterationAgentExamples = void 0;
73096
+ var types_1 = require_types_impl();
73097
+ var simpleWidgetExample = {
73098
+ currentExtensions: [],
73099
+ additionalExtensions: [
73100
+ {
73101
+ extensionType: types_1.ExtensionType.SITE_WIDGET,
73102
+ name: "Countdown Timer",
73103
+ relevantUserRequest: "Display a countdown timer widget on the site"
73104
+ }
73105
+ ],
73106
+ summary: "User wants a countdown timer widget on their site."
73107
+ };
73108
+ var reactComponentExample = {
73109
+ currentExtensions: [],
73110
+ additionalExtensions: [
73111
+ {
73112
+ extensionType: types_1.ExtensionType.SITE_COMPONENT,
73113
+ name: "Countdown Timer",
73114
+ relevantUserRequest: "Display a countdown timer as a React component on the site"
73115
+ }
73116
+ ],
73117
+ summary: "User wants a React countdown timer component on their site."
73118
+ };
73119
+ var popupWithDashboardExample = {
73120
+ currentExtensions: [],
73121
+ additionalExtensions: [
73122
+ {
73123
+ extensionType: types_1.ExtensionType.EMBEDDED_SCRIPT,
73124
+ name: "Promotional Popup",
73125
+ relevantUserRequest: "Display a promotional popup overlay on the site"
73126
+ },
73127
+ {
73128
+ extensionType: types_1.ExtensionType.DASHBOARD_PAGE,
73129
+ name: "Popup Manager",
73130
+ relevantUserRequest: "Admin interface to configure popup content, timing, and activation settings"
73131
+ }
73132
+ ],
73133
+ summary: "User wants a promotional popup. EMBEDDED_SCRIPT requires a DASHBOARD_PAGE for configuration."
73134
+ };
73135
+ var modifyExistingExample = {
73136
+ currentExtensions: [
73137
+ {
73138
+ extensionType: types_1.ExtensionType.SERVICE_PLUGIN,
73139
+ name: "Handling Fees Calculator",
73140
+ paths: ["src/backend/service-plugins/fees/plugin.ts"],
73141
+ relevantUserRequest: "Update the fee amount from $5 to $10"
73142
+ }
73143
+ ],
73144
+ additionalExtensions: [],
73145
+ summary: "User wants to update the existing fee amount in the service plugin."
73146
+ };
73147
+ var eventTriggerExample = {
73148
+ currentExtensions: [],
73149
+ additionalExtensions: [
73150
+ {
73151
+ extensionType: types_1.ExtensionType.BACKEND_EVENT,
73152
+ name: "Contact Creation Logger",
73153
+ relevantUserRequest: "Listen for contact creation events and log new contacts automatically"
73154
+ }
73155
+ ],
73156
+ summary: "User wants automatic logging when contacts are created."
73157
+ };
73158
+ var widgetWithDashboardExample = {
73159
+ currentExtensions: [],
73160
+ additionalExtensions: [
73161
+ {
73162
+ extensionType: types_1.ExtensionType.SITE_WIDGET,
73163
+ name: "Product Showcase",
73164
+ relevantUserRequest: "Display featured products in a widget on the site"
73165
+ },
73166
+ {
73167
+ extensionType: types_1.ExtensionType.DASHBOARD_PAGE,
73168
+ name: "Featured Products Manager",
73169
+ relevantUserRequest: "Admin interface to select and manage which products are featured"
73170
+ }
73171
+ ],
73172
+ summary: "User wants a product showcase widget with a dashboard for managing featured products."
73173
+ };
73174
+ var modifyAndCreateExample = {
73175
+ currentExtensions: [
73176
+ {
73177
+ extensionType: types_1.ExtensionType.DASHBOARD_PAGE,
73178
+ name: "Settings Dashboard",
73179
+ paths: ["src/dashboard/pages/settings/page.tsx"],
73180
+ relevantUserRequest: "Add a color picker input to the settings form"
73181
+ }
73182
+ ],
73183
+ additionalExtensions: [
73184
+ {
73185
+ extensionType: types_1.ExtensionType.DASHBOARD_PAGE,
73186
+ name: "Analytics Dashboard",
73187
+ relevantUserRequest: "Create a new dashboard page for viewing analytics data"
73188
+ }
73189
+ ],
73190
+ summary: "User wants to modify existing settings dashboard and create a new analytics dashboard."
73191
+ };
73192
+ var servicePluginExample = {
73193
+ currentExtensions: [],
73194
+ additionalExtensions: [
73195
+ {
73196
+ extensionType: types_1.ExtensionType.SERVICE_PLUGIN,
73197
+ name: "Custom Shipping Rates",
73198
+ relatedSpis: ["ecom.shippingRates.getShippingRates"],
73199
+ relevantUserRequest: "Calculate custom shipping rates based on destination region"
73200
+ }
73201
+ ],
73202
+ summary: "User wants custom shipping rate calculations at checkout."
73203
+ };
73204
+ var fixedFeesWithDashboardExample = {
73205
+ currentExtensions: [],
73206
+ additionalExtensions: [
73207
+ {
73208
+ extensionType: types_1.ExtensionType.SERVICE_PLUGIN,
73209
+ name: "Fixed Shipping Fees",
73210
+ relatedSpis: ["ecom.additionalFees.calculateAdditionalFees"],
73211
+ relevantUserRequest: "Apply fixed-cost shipping fees at checkout by reading fee configuration from database"
73212
+ },
73213
+ {
73214
+ extensionType: types_1.ExtensionType.DASHBOARD_PAGE,
73215
+ name: "Shipping Fees Manager",
73216
+ relevantUserRequest: "Admin interface to create, edit, and delete fixed shipping fees stored in a database collection"
73217
+ }
73218
+ ],
73219
+ summary: "User wants a fixed-cost shipping fees system with Additional Fees SPI and a dashboard to manage fee configurations stored in a database."
73220
+ };
73221
+ exports2.iterationAgentExamples = `### Example 1: Simple Widget Request (NO extra extensions)
73222
+ **User Request:** "I want to add a countdown timer to my site"
73223
+ **Existing Extensions:** None
73224
+
73225
+ **Expected Output:**
73226
+ ${JSON.stringify(simpleWidgetExample, null, 2)}
73227
+ **Why:** User asked for a widget only. Do NOT add a dashboard - SITE_WIDGET has built-in settings panel.
73228
+
73229
+ ---
73230
+
73231
+ ### Example 2: Widget with Explicit React Request
73232
+ **User Request:** "Create a countdown timer React component for my site"
73233
+ **Existing Extensions:** None
73234
+
73235
+ **Expected Output:**
73236
+ ${JSON.stringify(reactComponentExample, null, 2)}
73237
+ **Why:** User explicitly said "React", so use SITE_COMPONENT instead of SITE_WIDGET.
73238
+
73239
+ ---
73240
+
73241
+ ### Example 3: Popup Request (MANDATORY Dashboard Pairing)
73242
+ **User Request:** "I want a promotional popup on my site"
73243
+ **Existing Extensions:** None
73244
+
73245
+ **Expected Output:**
73246
+ ${JSON.stringify(popupWithDashboardExample, null, 2)}
73247
+ **Why:** EMBEDDED_SCRIPT MUST always be paired with DASHBOARD_PAGE - this is a technical requirement.
73248
+
73249
+ ---
73250
+
73251
+ ### Example 4: Modify Existing Extension
73252
+ **User Request:** "Change the fee from $5 to $10"
73253
+ **Existing Extensions:** SERVICE_PLUGIN "Handling Fees Calculator" at src/backend/service-plugins/fees/
73254
+
73255
+ **Expected Output:**
73256
+ ${JSON.stringify(modifyExistingExample, null, 2)}
73257
+ **Why:** Modify existing extension instead of creating new one. User didn't ask for anything new.
73258
+
73259
+ ---
73260
+
73261
+ ### Example 5: Event Trigger Pattern
73262
+ **User Request:** "When a new contact is created, log it automatically"
73263
+ **Existing Extensions:** None
73264
+
73265
+ **Expected Output:**
73266
+ ${JSON.stringify(eventTriggerExample, null, 2)}
73267
+ **Why:** Trigger pattern "when...created" indicates BACKEND_EVENT. No dashboard needed unless requested.
73268
+
73269
+ ---
73270
+
73271
+ ### Example 6: Explicit Dashboard Request with Widget
73272
+ **User Request:** "Create a product showcase widget AND a dashboard to manage featured products"
73273
+ **Existing Extensions:** None
73274
+
73275
+ **Expected Output:**
73276
+ ${JSON.stringify(widgetWithDashboardExample, null, 2)}
73277
+ **Why:** User explicitly asked for BOTH a widget AND a dashboard - honor both requests.
73278
+
73279
+ ---
73280
+
73281
+ ### Example 7: Add Feature to Existing + Create New
73282
+ **User Request:** "Add a color picker to the existing dashboard, and create a new analytics dashboard"
73283
+ **Existing Extensions:** DASHBOARD_PAGE "Settings Dashboard" at src/dashboard/pages/settings/
73284
+
73285
+ **Expected Output:**
73286
+ ${JSON.stringify(modifyAndCreateExample, null, 2)}
73287
+ **Why:** User said "add to existing" (modify) AND "create a new" (additional). Honor both.
73288
+
73289
+ ---
73290
+
73291
+ ### Example 8: Service Plugin for eCommerce
73292
+ **User Request:** "I need custom shipping rates based on destination"
73293
+ **Existing Extensions:** None
73294
+
73295
+ **Expected Output:**
73296
+ ${JSON.stringify(servicePluginExample, null, 2)}
73297
+ **Why:** User asked for shipping rates logic only. Do NOT add dashboard unless explicitly requested.
73298
+
73299
+ ---
73300
+
73301
+ ### Example 9: Full eCommerce Solution with SPI + Dashboard + Database
73302
+ **User Request:** "Build an app that adds fixed-cost shipping fees at checkout using the Additional Fees SPI. The app should save the fee description text and amount in a dedicated database collection. Also provide the user with a dashboard to manage these fixed fees."
73303
+ **Existing Extensions:** None
73304
+
73305
+ **Expected Output:**
73306
+ ${JSON.stringify(fixedFeesWithDashboardExample, null, 2)}
73307
+ **Why:** User explicitly requested BOTH a SERVICE_PLUGIN (Additional Fees SPI) AND a DASHBOARD_PAGE to manage fees. The database collection is handled by the Planner agent - no separate extension needed for CMS.`;
73308
+ }
73309
+ });
73310
+
73065
73311
  // dist/system-prompts/iterationAgent/iteration-agent-prompt.js
73066
73312
  var require_iteration_agent_prompt = __commonJS({
73067
73313
  "dist/system-prompts/iterationAgent/iteration-agent-prompt.js"(exports2) {
@@ -73071,6 +73317,7 @@ var require_iteration_agent_prompt = __commonJS({
73071
73317
  var codegen_common_logic_1 = require_dist9();
73072
73318
  var iterartion_agent_instructions_1 = require_iterartion_agent_instructions();
73073
73319
  var AgentsRegistry_1 = require_AgentsRegistry();
73320
+ var iteration_examples_1 = require_iteration_examples();
73074
73321
  var iterationAgentPrompt = () => {
73075
73322
  const supportedTypes = (0, AgentsRegistry_1.getSupportedExtensionTypes)().join(", ");
73076
73323
  const supportedExtensions = (0, AgentsRegistry_1.generateSupportedExtensionsSection)();
@@ -73078,7 +73325,7 @@ var require_iteration_agent_prompt = __commonJS({
73078
73325
  const keyPoints = (0, iterartion_agent_instructions_1.getIterationAgentKeyPoints)(supportedTypes);
73079
73326
  const systemPrompt = new codegen_common_logic_1.SystemPromptBuilder({
73080
73327
  agentType: codegen_common_logic_1.GeneralAgentType.ITERATION_AGENT
73081
- }).withRole(iterartion_agent_instructions_1.iterationAgentRole).withSection("chat_history_context", iterartion_agent_instructions_1.iterationAgentChatHistoryContext).withSection("common_iteration_scenarios", iterartion_agent_instructions_1.iterationAgentCommonScenariosDocumentation).withSection("quick_decision_guide", iterartion_agent_instructions_1.iterationAgentQuickDecisionGuide).withSection("common_use_cases_guide", iterartion_agent_instructions_1.iterationAgentCommonUseCasesGuide).withSection("supported_extension_types", supportedExtensions).withSection("extension_selection_logic", iterartion_agent_instructions_1.iterationAgentExtensionSelectionLogic).withSection("constraints", constraints).withSection("key_points", keyPoints);
73328
+ }).withRole(iterartion_agent_instructions_1.iterationAgentRole).withSection("chat_history_context", iterartion_agent_instructions_1.iterationAgentChatHistoryContext).withSection("common_iteration_scenarios", iterartion_agent_instructions_1.iterationAgentCommonScenariosDocumentation).withSection("quick_decision_guide", iterartion_agent_instructions_1.iterationAgentQuickDecisionGuide).withSection("common_use_cases_guide", iterartion_agent_instructions_1.iterationAgentCommonUseCasesGuide).withSection("supported_extension_types", supportedExtensions).withSection("extension_selection_logic", iterartion_agent_instructions_1.iterationAgentExtensionSelectionLogic).withSection("constraints", constraints).withSection("key_points", keyPoints).withExamples(iteration_examples_1.iterationAgentExamples);
73082
73329
  return systemPrompt.compose();
73083
73330
  };
73084
73331
  exports2.iterationAgentPrompt = iterationAgentPrompt;
@@ -73266,7 +73513,7 @@ var require_IterationAgent = __commonJS({
73266
73513
  "dist/agents/Iteration/IterationAgent.js"(exports2) {
73267
73514
  "use strict";
73268
73515
  Object.defineProperty(exports2, "__esModule", { value: true });
73269
- exports2.IterationAgent = void 0;
73516
+ exports2.IterationAgent = exports2.IterationPlanSchema = void 0;
73270
73517
  var zod_1 = require_zod();
73271
73518
  var ai_1 = require_dist8();
73272
73519
  var iteration_agent_prompt_1 = require_iteration_agent_prompt();
@@ -73291,7 +73538,7 @@ var require_IterationAgent = __commonJS({
73291
73538
  relatedSpis: zod_1.z.array(zod_1.z.string()).optional().describe("Optional value, only for SPI extensions - specify the SPI types"),
73292
73539
  relevantUserRequest: zod_1.z.string().describe("What part of the user request this extension should do, do not reference other extensions.")
73293
73540
  });
73294
- var IterationPlanSchema = zod_1.z.object({
73541
+ exports2.IterationPlanSchema = zod_1.z.object({
73295
73542
  currentExtensions: zod_1.z.array(CurrentExtensionSchema).describe("Existing extensions to be triggered, return [] if no existing extensions are needed"),
73296
73543
  additionalExtensions: zod_1.z.array(AdditionalExtensionSchema).describe("New extensions to be created, return [] if no new extensions are needed"),
73297
73544
  summary: zod_1.z.string().describe("Summary of the chat with the user request")
@@ -73374,7 +73621,7 @@ ${(0, extensionFormatters_1.formatContextExtensions)(extensionSelectorResult.con
73374
73621
  systemPrompt: this.buildSystemPrompt(),
73375
73622
  provider: constants_1.LLM_PROVIDERS.ANTHROPIC,
73376
73623
  model: constants_1.LLM_MODELS.CLAUDE_3_5_HAIKU_LATEST,
73377
- schema: IterationPlanSchema,
73624
+ schema: exports2.IterationPlanSchema,
73378
73625
  agentName: this.name,
73379
73626
  experimental_repairText: this.repairNameTooLong
73380
73627
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.196",
3
+ "version": "1.0.197",
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": "e9a4627816f3b173ce107beedd4b417293a1cb27a8d04eb4ce405b0b"
27
+ "falconPackageHash": "b19d9ec4dad95f06bab6e6d83ce26a53a04edea1f5128c85acdb0ba5"
28
28
  }