@wix/ditto-codegen-public 1.0.287 → 1.0.289

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 +24 -144
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -11637,130 +11637,6 @@ var require_constants5 = __commonJS({
11637
11637
  }
11638
11638
  });
11639
11639
 
11640
- // dist/opencode-integration/rules/orchestrator-rules.js
11641
- var require_orchestrator_rules = __commonJS({
11642
- "dist/opencode-integration/rules/orchestrator-rules.js"(exports2) {
11643
- "use strict";
11644
- Object.defineProperty(exports2, "__esModule", { value: true });
11645
- exports2.ORCHESTRATOR_RULES = void 0;
11646
- exports2.ORCHESTRATOR_RULES = `# Wix CLI Extension Orchestrator
11647
-
11648
- ## Quick Decision Helper
11649
-
11650
- Answer these questions to find the right extension:
11651
-
11652
- 1. **What are you trying to build?**
11653
- - Admin interface \u2192 Dashboard Extensions
11654
- - Backend logic \u2192 Backend Extensions
11655
- - Data storage / CMS collections \u2192 Data Collection
11656
- - Site component \u2192 Site Extensions (app projects only)
11657
-
11658
- 2. **Who will see it?**
11659
- - Admin users only \u2192 Dashboard Extensions
11660
- - Site visitors \u2192 Site Extensions
11661
- - Server-side only \u2192 Backend Extensions
11662
-
11663
- 3. **Where will it appear?**
11664
- - Dashboard sidebar/page \u2192 Dashboard Page or Modal
11665
- - Existing Wix app dashboard (widget) \u2192 Dashboard Plugin
11666
- - Existing Wix app dashboard (menu item) \u2192 Dashboard Menu Plugin
11667
- - Anywhere on site \u2192 Site Widget
11668
- - Anywhere on site (with editor manifest) \u2192 Site Component
11669
- - Wix business solution page \u2192 Site Plugin
11670
- - During business flow \u2192 Service Plugin
11671
- - After event occurs \u2192 Event Extension
11672
-
11673
- ## Decision Flow
11674
-
11675
- - **Admin:** Need full-page UI? \u2192 Dashboard Page. Need popup/form? \u2192 Dashboard Modal. Extending Wix app dashboard with a visual widget? \u2192 Dashboard Plugin. Adding a menu item to a Wix app dashboard's more-actions or bulk-actions menu? \u2192 Dashboard Menu Plugin. **Modal constraint:** Dashboard Pages cannot use \`<Modal />\`; use a separate Dashboard Modal extension and \`dashboard.openModal()\`.
11676
- - **Backend:** During business flow (checkout/shipping/tax)? \u2192 Service Plugin. After event (webhooks/sync)? \u2192 Event Extension. Custom HTTP endpoints? \u2192 Backend Endpoints. Need CMS collections for app data? \u2192 Data Collection.
11677
- - **Site:** User places anywhere (standalone)? \u2192 Site Widget. React component with editor manifest (styling, content, elements)? \u2192 Site Component. Fixed slot on Wix app page? \u2192 Site Plugin. Scripts/analytics only? \u2192 Embedded Script.
11678
-
11679
- ## Extension Type \u2192 Skill Reference
11680
-
11681
- | Extension Type | Category | Visibility | Use When | Skill |
11682
- | --------------------- | --------- | ----------- | ----------------------------- | ------------------------- |
11683
- | Dashboard Page | Dashboard | Admin only | Full admin pages | \`wix-cli-dashboard-page\` |
11684
- | Dashboard Modal | Dashboard | Admin only | Popup dialogs | \`wix-cli-dashboard-modal\` |
11685
- | Dashboard Plugin | Dashboard | Admin only | Extend Wix app dashboards | \`wix-cli-dashboard-plugin\` |
11686
- | Dashboard Menu Plugin | Dashboard | Admin only | Add menu items to Wix app dashboards | \`wix-cli-dashboard-menu-plugin\` |
11687
- | Service Plugin | Backend | Server-side | Customize business flows | \`wix-cli-service-plugin\` |
11688
- | Event Extension | Backend | Server-side | React to events | \`wix-cli-backend-event\` |
11689
- | Backend Endpoints | Backend | API | Custom HTTP handlers | \`wix-cli-backend-api\` |
11690
- | Data Collection | Backend | Data | CMS collections for app data | \`wix-cli-data-collection\` |
11691
- | Site Component | Site | Public | React components with editor manifests | \`wix-cli-site-component\` |
11692
- | Site Widget | Site | Public | Standalone widgets | \`wix-cli-site-widget\` |
11693
- | Site Plugin | Site | Public | Extend Wix business solutions | \`wix-cli-site-plugin\` |
11694
- | Embedded Script | Site | Public | Inject scripts/analytics | \`wix-cli-embedded-script\` |
11695
-
11696
- | Site Widget vs Site Component vs Site Plugin | Dashboard Page vs Modal | Service Plugin vs Event |
11697
- | -------------------------------------------- | ----------------------- | ----------------------- |
11698
- | Widget: standalone interactive component. Component: React with editor manifest (CSS/data/elements). Plugin: fixed slot in Wix app page. | Page: full page. Modal: overlay; use for popups. | Service: during flow. Event: after event. |
11699
-
11700
- ## Data Collection Inference
11701
-
11702
- **CRITICAL:** Data collections are often needed implicitly \u2014 don't wait for the user to explicitly say "create a CMS collection." Infer the need automatically.
11703
-
11704
- **Skip this section if the user provides a collection ID directly** (e.g., an existing site-level collection). In that case, use the provided ID as-is \u2014 no Data Collection extension or namespace scoping needed.
11705
-
11706
- **Always include a Data Collection extension when ANY of these are true:**
11707
-
11708
- | Indicator | Example |
11709
- | --- | --- |
11710
- | User mentions saving/storing/persisting app-specific data | "save the fee amount", "store product recommendations" |
11711
- | A dashboard page will **manage** (CRUD) domain entities | "dashboard to manage fees", "admin page to edit rules" |
11712
- | A service plugin reads app-configured data at runtime | "fetch fee rules at checkout", "look up shipping rates" |
11713
- | User mentions "dedicated database/collection" | "save in a dedicated database collection" |
11714
- | Multiple extensions reference the same custom data | Dashboard manages fees + service plugin reads fees |
11715
-
11716
- **Why this matters:** Without the Data Collection extension, the collection won't be created when the app is installed, the Wix Data APIs may not work (code editor not enabled), and collection IDs won't be properly scoped to the app namespace.
11717
-
11718
- When creating a Data Collection, the user MUST provide their app namespace from Wix Dev Center. Collection IDs must be scoped: \`<app-namespace>/<idSuffix>\` \u2014 pass the full ID to all extensions that reference the collection.
11719
-
11720
- ## Wix Stores Versioning Requirement
11721
-
11722
- **Applies when ANY Wix Stores API is used** (products, inventory, orders, etc.):
11723
-
11724
- 1. Load the \`wix-stores-versioning\` skill
11725
- 2. All Stores operations must check catalog version first using \`getCatalogVersion()\`
11726
- 3. Use the correct module based on version: \`productsV3\` (V3) vs \`products\` (V1)
11727
-
11728
- This is non-negotiable \u2014 V1 and V3 are NOT backwards compatible.
11729
-
11730
- ## API Reference Discovery
11731
-
11732
- **Workflow: Check skill references first, use MCP only for gaps.**
11733
-
11734
- 1. Identify required APIs from user requirements
11735
- 2. Check relevant reference files in the loaded skill
11736
- 3. ONLY use MCP if the API is NOT found in reference files
11737
-
11738
- **Platform APIs (always in skill references \u2014 skip MCP):**
11739
- - Wix Data, Dashboard SDK, Event SDK (common events), Service Plugin SPIs
11740
-
11741
- **Vertical APIs (use MCP if needed):**
11742
- - Wix Stores (\u26A0\uFE0F MUST use \`wix-stores-versioning\` skill), Wix Bookings, Wix Members, Wix Pricing Plans
11743
-
11744
- | User Requirement | MCP Needed? | Reason |
11745
- | --- | --- | --- |
11746
- | "Display store products" | \u2705 YES | Wix Stores API \u2014 also load \`wix-stores-versioning\` skill |
11747
- | "Show booking calendar" | \u2705 YES | Wix Bookings API not in reference files |
11748
- | "Send emails to users" | \u2705 YES | Wix Triggered Emails not in reference files |
11749
- | "Get member info" | \u2705 YES | Wix Members API not in reference files |
11750
- | "Listen for cart events" | Check \`COMMON-EVENTS.md\` | MCP only if event missing in reference |
11751
- | "Store data in collection" | \u274C NO | Covered by \`WIX_DATA.md\` in skill refs |
11752
- | "Show dashboard toast" | \u274C NO | Covered by \`DASHBOARD_API.md\` in skill refs |
11753
- | "UI only (forms, inputs)" | \u274C NO | No external API needed |
11754
-
11755
- **MCP Tools to use for discovery:**
11756
- - \`SearchWixSDKDocumentation\` - SDK methods and APIs (**Always use maxResults: 5**)
11757
- - \`ReadFullDocsArticle\` - Full documentation when needed (only if search results need more detail)
11758
- - \`ReadFullDocsMethodSchema\` - **Always call this** for any SDK method you plan to use. The schema is the source of truth for parameter shapes. Code examples may have incorrect call signatures.
11759
-
11760
- \u26A0\uFE0F MANDATORY when using WDS: Invoke the wds-docs skill FIRST to get correct imports.`;
11761
- }
11762
- });
11763
-
11764
11640
  // dist/opencode-integration/rules/codegen-rules.js
11765
11641
  var require_codegen_rules = __commonJS({
11766
11642
  "dist/opencode-integration/rules/codegen-rules.js"(exports2) {
@@ -11779,7 +11655,7 @@ MINIMIZE TEXT OUTPUT \u2014 CRITICAL:
11779
11655
  - Every text token costs money. Use tools, not words.
11780
11656
 
11781
11657
  TOOL USAGE:
11782
- - \`validate\` for all validation (tsc + build). Do NOT load the \`wix-cli-app-validation\` skill.
11658
+ - \`validate\` for all validation (tsc + build).
11783
11659
  - \`uuid\` to generate UUIDs (supports count param for multiple). Do NOT use bash.
11784
11660
  - \`batch-write\` to create new files. NEVER use \`write\` for new files (corrupts newlines).
11785
11661
  - \`batch-read\` to read multiple files at once.
@@ -11789,12 +11665,11 @@ TOOL USAGE:
11789
11665
  - NEVER run preview, dev, release, or promote commands.
11790
11666
 
11791
11667
  IMPLEMENTATION WORKFLOW:
11792
- 1. **Plan**: Determine extension types using the orchestrator rule. Generate ALL UUIDs upfront.
11793
- 2. **Load skills**: Load ALL needed extension skills.
11794
- 3. **Build**: Create each extension using \`batch-write\`. Build all extensions before registering.
11795
- 4. **Register**: Register all extensions in \`src/extensions.ts\`.
11796
- 5. **Validate**: Run \`validate\` with installDeps: true ONCE. Fix any errors and re-validate.
11797
- 6. **Stop**: Once validation passes, STOP. Do NOT refactor, clean up, or verify.
11668
+ 1. **Plan**: Determine extension types using the \`wix-app\` skill. Generate ALL UUIDs upfront.
11669
+ 2. **Build**: Create each extension using \`batch-write\`. Build all extensions before registering.
11670
+ 3. **Register**: Register all extensions in \`src/extensions.ts\`.
11671
+ 4. **Validate**: Run \`validate\` with installDeps: true ONCE. Fix any errors and re-validate.
11672
+ 5. **Stop**: Once validation passes, STOP. Do NOT refactor, clean up, or verify.
11798
11673
 
11799
11674
  EFFICIENCY:
11800
11675
  - Batch ALL tool calls that can run in parallel into the same step.
@@ -11854,24 +11729,21 @@ var require_rules_writer = __commonJS({
11854
11729
  "dist/opencode-integration/rules-writer.js"(exports2) {
11855
11730
  "use strict";
11856
11731
  Object.defineProperty(exports2, "__esModule", { value: true });
11857
- exports2.ASK_RULES_PATH = exports2.ORCHESTRATOR_RULES_PATH = exports2.CODEGEN_RULES_PATH = void 0;
11732
+ exports2.ASK_RULES_PATH = exports2.CODEGEN_RULES_PATH = void 0;
11858
11733
  exports2.writeRuleFiles = writeRuleFiles;
11859
11734
  var promises_1 = require("fs/promises");
11860
11735
  var os_1 = require("os");
11861
11736
  var path_1 = require("path");
11862
- var orchestrator_rules_1 = require_orchestrator_rules();
11863
11737
  var codegen_rules_1 = require_codegen_rules();
11864
11738
  var ask_rules_1 = require_ask_rules();
11865
11739
  var logger_12 = require_logger();
11866
11740
  var GLOBAL_RULES_DIR = (0, path_1.join)((0, os_1.homedir)(), ".config", "opencode", "rules");
11867
11741
  exports2.CODEGEN_RULES_PATH = (0, path_1.join)(GLOBAL_RULES_DIR, "codegen-instructions.md");
11868
- exports2.ORCHESTRATOR_RULES_PATH = (0, path_1.join)(GLOBAL_RULES_DIR, "orchestrator.md");
11869
11742
  exports2.ASK_RULES_PATH = (0, path_1.join)(GLOBAL_RULES_DIR, "ask-instructions.md");
11870
11743
  async function writeRuleFiles() {
11871
11744
  await (0, promises_1.mkdir)(GLOBAL_RULES_DIR, { recursive: true });
11872
11745
  await Promise.all([
11873
11746
  (0, promises_1.writeFile)(exports2.CODEGEN_RULES_PATH, codegen_rules_1.CODEGEN_RULES, "utf-8"),
11874
- (0, promises_1.writeFile)(exports2.ORCHESTRATOR_RULES_PATH, orchestrator_rules_1.ORCHESTRATOR_RULES, "utf-8"),
11875
11747
  (0, promises_1.writeFile)(exports2.ASK_RULES_PATH, ask_rules_1.ASK_RULES, "utf-8")
11876
11748
  ]);
11877
11749
  logger_12.logger.info("[OpenCode] Wrote global rule files", { dir: GLOBAL_RULES_DIR });
@@ -11977,9 +11849,7 @@ var require_config = __commonJS({
11977
11849
  "skill"
11978
11850
  /* OpenCodeTool.Skill */
11979
11851
  ]: {
11980
- "*": "allow",
11981
- "wix-cli-orchestrator": "deny",
11982
- "wix-cli-app-validation": "deny"
11852
+ "*": "allow"
11983
11853
  },
11984
11854
  task: "deny",
11985
11855
  doom_loop: "allow",
@@ -11997,7 +11867,7 @@ var require_config = __commonJS({
11997
11867
  "/root/.opencode/**": "allow"
11998
11868
  }
11999
11869
  },
12000
- instructions: [rules_writer_12.CODEGEN_RULES_PATH, rules_writer_12.ORCHESTRATOR_RULES_PATH],
11870
+ instructions: [rules_writer_12.CODEGEN_RULES_PATH],
12001
11871
  autoupdate: false,
12002
11872
  share: "disabled",
12003
11873
  lsp: false,
@@ -17671,7 +17541,7 @@ var require_pre_run_decision = __commonJS({
17671
17541
  const extensionName = siteUIExtension.name;
17672
17542
  const currentType = siteUIExtension.type;
17673
17543
  logger_12.logger.info(`[PreDecision] Found site UI extension: "${extensionName}" (current type: ${currentType})`);
17674
- const selectedType = await (0, job_decision_manager_1.askJobChoice)(jobId, `What type of site UI element would you like to create for "${extensionName}"?`, [
17544
+ const options = [
17675
17545
  {
17676
17546
  id: types_1.ExtensionType.SITE_WIDGET,
17677
17547
  label: "Custom Element Widget",
@@ -17682,7 +17552,9 @@ var require_pre_run_decision = __commonJS({
17682
17552
  label: "Editor React Component",
17683
17553
  description: "A React component that integrates with the site builder. Best for components that need to work with Wix editor features."
17684
17554
  }
17685
- ], "Custom Element Widgets are standalone embeddable units with their own styling, while Editor React Components integrate more deeply with the Wix editor and builder.");
17555
+ ];
17556
+ const selectedType = await (0, job_decision_manager_1.askJobChoice)(jobId, `What type of site UI element would you like to create for "${extensionName}"?`, options, "Custom Element Widgets are standalone embeddable units with their own styling, while Editor React Components integrate more deeply with the Wix editor and builder.");
17557
+ const selectedLabel = options.find((o) => o.id === selectedType)?.label ?? selectedType;
17686
17558
  const isTypeChanged = selectedType !== currentType;
17687
17559
  logger_12.logger.info(`[PreDecision] User selected ${selectedType} for "${extensionName}"${isTypeChanged ? ` (changed from ${currentType})` : " (unchanged)"}`);
17688
17560
  const appliedDecision = {
@@ -17692,18 +17564,26 @@ var require_pre_run_decision = __commonJS({
17692
17564
  };
17693
17565
  return {
17694
17566
  decisionsApplied: [appliedDecision],
17695
- modifiedBlueprint: context.blueprint ? applyTypeToBlueprint(context.blueprint, extensionName, selectedType) : void 0
17567
+ modifiedBlueprint: context.blueprint ? applyTypeToBlueprint(context.blueprint, extensionName, selectedType, selectedLabel) : void 0
17696
17568
  };
17697
17569
  }
17698
17570
  function isSiteUIExtension(extension) {
17699
17571
  return extension.type === types_1.ExtensionType.SITE_WIDGET || extension.type === types_1.ExtensionType.SITE_COMPONENT;
17700
17572
  }
17701
- function applyTypeToBlueprint(blueprint, extensionName, type) {
17573
+ function applyTypeToBlueprint(blueprint, extensionName, type, label) {
17574
+ const summaryNotice = `[USER DECISION] The user explicitly chose "${label}" for the "${extensionName}" extension. You MUST generate it as type ${type}. Do NOT use any other type.`;
17575
+ const descriptionNotice = `[USER DECISION] This extension MUST be a ${label} (type: ${type}). The user explicitly chose this. Do NOT change it.`;
17702
17576
  return {
17703
17577
  ...blueprint,
17578
+ summary: `${summaryNotice}
17579
+
17580
+ ${blueprint.summary ?? ""}`.trim(),
17704
17581
  extensions: blueprint.extensions?.map((ext) => ext.name === extensionName ? {
17705
17582
  ...ext,
17706
17583
  type,
17584
+ description: `${descriptionNotice}
17585
+
17586
+ ${ext.description ?? ""}`.trim(),
17707
17587
  _userDecision: "IMPORTANT: The user explicitly chose this extension type. You MUST use this exact type."
17708
17588
  } : ext)
17709
17589
  };
@@ -18272,7 +18152,7 @@ var require_skills_installer = __commonJS({
18272
18152
  var ditto_codegen_types_12 = require_dist4();
18273
18153
  var skills_override_1 = require_skills_override();
18274
18154
  var execAsync = (0, util_1.promisify)(child_process_1.exec);
18275
- var SKILLS_INSTALL_COMMAND = "npx --yes skills add wix/skills -g -a opencode -y";
18155
+ var SKILLS_INSTALL_COMMAND = "npx --yes skills add wix/skills -s wix-app wds-docs -g -a opencode -y";
18276
18156
  async function installSkills(outputPath, log) {
18277
18157
  const skillsOverride = process.env.SKILLS_OVERRIDE_BRANCH;
18278
18158
  const isPreInstalled = (0, fs_1.existsSync)(skills_override_1.SKILLS_DIR) && (0, fs_1.readdirSync)(skills_override_1.SKILLS_DIR).length > 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.287",
3
+ "version": "1.0.289",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -27,5 +27,5 @@
27
27
  "@wix/ditto-codegen": "1.0.0",
28
28
  "esbuild": "^0.27.2"
29
29
  },
30
- "falconPackageHash": "cfca0a7d26f668b5e6db9393a69bea9ac4300d1ae7d0b2084d0543a1"
30
+ "falconPackageHash": "bb08ee9c7e969e69ea38701891166f003b901a43cec3f34e1276f843"
31
31
  }