@wix/ditto-codegen-public 1.0.405 → 1.0.406

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 +81 -29
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -11595,9 +11595,10 @@ Then summarize each error: message, file, root cause, fix. No diffs.
11595
11595
  var WIX_DOCS_DESCRIPTION = `Use ONLY to discover a Wix SDK you don't know and that the skills +
11596
11596
  KNOWN WIX APIS don't cover. Send ONE complete question; returns the import path
11597
11597
  + exported namespace/method + runtime context + full signature + any required
11598
- scope/permission IDs + a short usage example (not a link). Don't fetch a doc you
11599
- already identified, and don't split a lookup into separate search/signature
11600
- calls. Read-only.`;
11598
+ scope/permission IDs + any user setup prerequisites (dependent app to install,
11599
+ dashboard setting to enable, template to create) + a short usage example (not a
11600
+ link). Don't fetch a doc you already identified, and don't split a lookup into
11601
+ separate search/signature calls. Read-only.`;
11601
11602
  var WIX_DOCS_PROMPT = `You research Wix SDK APIs via wix-mcp and report back \u2014 never write app code.
11602
11603
  The caller uses DIRECT imports inside an extension that already supplies
11603
11604
  auth/host: 'import { <namespace> } from "@wix/<pkg>"; await <namespace>.<method>(<optionsObject>)'
@@ -11608,12 +11609,17 @@ introduction ('SearchWixSDKDocumentation' \u2192 'ReadFullDocsArticle') to confi
11608
11609
  it's the RIGHT API and its runtime context \u2014 backend, the dashboard host, or the
11609
11610
  site/editor host (host modules like @wix/dashboard work ONLY in their own host);
11610
11611
  (2) read 'ReadFullDocsMethodSchema' for the exact exported name and its
11611
- options-object parameters. Reply with: the import path + exported
11612
- namespace/method, the runtime context, the full TypeScript signature, and a
11613
- short usage example \u2014 never a bare link, never 'as any' or a guessed method. If
11614
- the API is limited to one context, say so. For a required scope/permission,
11615
- return the EXACT scope-ID string from the docs (never a guessed format); if none
11616
- is documented, say so.`;
11612
+ options-object parameters; (3) capture any user SETUP prerequisites the docs
11613
+ call out (often a 'Before you begin' section) \u2014 a dependent app that must be
11614
+ installed (e.g. Wix Stores, Members Area), a dashboard setting that must be
11615
+ enabled (e.g. Automations for back-in-stock notifications), or a template/config
11616
+ the user must create first (e.g. a triggered email). Reply with: the import path
11617
+ + exported namespace/method, the runtime context, the full TypeScript signature,
11618
+ a short usage example \u2014 never a bare link, never 'as any' or a guessed method \u2014
11619
+ and a SETUP STEPS list of the prerequisites from (3) so the main agent can relay
11620
+ them to the user (say 'none' if there are none). If the API is limited to one
11621
+ context, say so. For a required scope/permission, return the EXACT scope-ID
11622
+ string from the docs (never a guessed format); if none is documented, say so.`;
11617
11623
  var WDS_DOCS_DESCRIPTION = `Use ONLY when building dashboard UI and you need a Wix Design System
11618
11624
  component/prop/example you don't know and the skills don't cover.
11619
11625
  Returns the component name + props + a short usage example. Not for layouts the
@@ -12029,6 +12035,7 @@ var require_dist5 = __commonJS({
12029
12035
  return check_site_ui_decision_1.createCheckSiteUIDecision;
12030
12036
  } });
12031
12037
  exports2.appBuilderCodegenConfig = {
12038
+ environmentIdentity: "You generate a Wix CLI app (a code-first Wix app) on a dev machine. The user previews it on a dev site and releases it from the product UI.",
12032
12039
  codegenRules: [],
12033
12040
  askRules: [],
12034
12041
  gitConflictsRules: [],
@@ -14370,6 +14377,7 @@ var require_dist8 = __commonJS({
14370
14377
  var codegen_checkpoint_plugin_1 = require_dist6();
14371
14378
  var codegen_common_logic_1 = require_dist7();
14372
14379
  exports2.studio2CodegenConfig = {
14380
+ environmentIdentity: "You generate code for the user's own live Wix site \u2014 to the user it's just their site, not a separate app they're aware of. Your changes are saved and applied to the site automatically; there is no separate release step.",
14373
14381
  codegenRules: [
14374
14382
  { filename: "site-data-layer-rules.md", content: codegen_common_logic_1.SITE_DATA_LAYER_RULES },
14375
14383
  { filename: "studio-2-site-ui-rules.md", content: codegen_common_logic_1.STUDIO_2_SITE_UI_RULES }
@@ -14723,6 +14731,7 @@ var require_dist10 = __commonJS({
14723
14731
  var codegen_feature_vibe_plugin_1 = require_dist9();
14724
14732
  var codegen_common_logic_1 = require_dist7();
14725
14733
  exports2.harmonyCodegenConfig = {
14734
+ environmentIdentity: "You generate code for the user's own live Wix site \u2014 to the user it's just their site, not a separate app they're aware of. Your changes are saved and applied to the site automatically; there is no separate release step.",
14726
14735
  codegenRules: [
14727
14736
  { filename: "site-data-layer-rules.md", content: codegen_common_logic_1.SITE_DATA_LAYER_RULES }
14728
14737
  ],
@@ -14735,13 +14744,36 @@ var require_dist10 = __commonJS({
14735
14744
  }
14736
14745
  });
14737
14746
 
14747
+ // dist/opencode-integration/rules/shared-rules.js
14748
+ var require_shared_rules = __commonJS({
14749
+ "dist/opencode-integration/rules/shared-rules.js"(exports2) {
14750
+ "use strict";
14751
+ Object.defineProperty(exports2, "__esModule", { value: true });
14752
+ exports2.OUTPUT_MESSAGE_RULES = exports2.BOUNDARY_RULES = void 0;
14753
+ exports2.buildEnvironmentRules = buildEnvironmentRules;
14754
+ function buildEnvironmentRules(environmentIdentity) {
14755
+ return `ENVIRONMENT:
14756
+ ${environmentIdentity}`;
14757
+ }
14758
+ exports2.BOUNDARY_RULES = `YOUR BOUNDARIES:
14759
+ - You only write code. You cannot release, publish, upload/download files, or do other product/platform actions for the user \u2014 those are the user's to do in the UI, not yours.
14760
+ - If asked how to do such a product/platform action (download/upload files, release, manage app info, use git or the IDE, etc.), do NOT explain the steps or name specific tools, surfaces, or locations \u2014 it varies by environment and you may be wrong. Just say it's outside what you do (you only write code) and that it's done in the UI, not through code.
14761
+ - Don't mention internal/sandbox details (e.g. paths like \`/user-code\`) \u2014 the user can't see them.`;
14762
+ exports2.OUTPUT_MESSAGE_RULES = `OUTPUT MESSAGE (shown to the user):
14763
+ - Match their technical level: include code/technical detail only if their request was technical; otherwise describe the outcome in plain language (no code, file/type names, or internals).
14764
+ - List any manual setup the user must still do for the feature to work, as short "next steps" (e.g. installing a dependent app or enabling a dashboard setting).
14765
+ - Be honest: if you didn't fully build what was asked (e.g. stored data but didn't send it), say so. Keep it short.`;
14766
+ }
14767
+ });
14768
+
14738
14769
  // dist/opencode-integration/rules/codegen-rules.js
14739
14770
  var require_codegen_rules = __commonJS({
14740
14771
  "dist/opencode-integration/rules/codegen-rules.js"(exports2) {
14741
14772
  "use strict";
14742
14773
  Object.defineProperty(exports2, "__esModule", { value: true });
14743
- exports2.CODEGEN_RULES = void 0;
14744
- exports2.CODEGEN_RULES = `CORE PRINCIPLES:
14774
+ exports2.buildCodegenRules = buildCodegenRules;
14775
+ var shared_rules_1 = require_shared_rules();
14776
+ var CODEGEN_CORE_RULES = `CORE PRINCIPLES:
14745
14777
  - Do NOT invent or assume new types, modules, functions, props, events, or imports.
14746
14778
  - NEVER use mocks, placeholders, debugging, or TODOs in any code.
14747
14779
  - ALWAYS implement complete, production-ready functionality.
@@ -14781,7 +14813,7 @@ IMPLEMENTATION WORKFLOW:
14781
14813
  4. **Register**: Register all extensions in \`src/extensions.ts\`.
14782
14814
  5. **Validate**: Dispatch ONE \`task({ subagent: "codegen-validator", prompt: "Run validate({ runBuild: true }) \u2014 it typechecks AND builds in a single pass (tsc runs first and fails fast before the build). Fix any errors and re-run until it passes. Pass installDeps: true only if package.json changed and npm install was not already run in this session." })\`. Wait for the subagent to return. Do NOT call \`validate\` directly from the primary agent, and do NOT make a separate tsc-only call first \u2014 the single runBuild pass already fails fast on type errors. VERIFY the subagent actually FINISHED with a clean build: read its returned summary and confirm it converged. If it reports remaining/unresolved errors or was cut off before finishing (e.g. "Maximum steps reached"), do NOT treat it as success \u2014 re-dispatch \`codegen-validator\` to finish the remaining errors before moving on.
14783
14815
  6. **Declare permissions**: If the generated code requires Wix app permissions, call \`required-permissions\` ONCE with their SCOPE IDs (see PERMISSIONS below). Skip this step entirely if no permissions are needed.
14784
- 7. **Final message**: Your last message is returned to the user as the codegen output \u2014 keep it short and plain (a sentence or two on what the app now does).
14816
+ 7. **Final message**: Your last message is returned to the user as the codegen output \u2014 keep it short and plain (a sentence or two on what the app now does). Do NOT mention permissions/scopes here (see PERMISSIONS) and follow OUTPUT MESSAGE below.
14785
14817
  8. **Stop**: STOP immediately. Do NOT refactor, clean up, or verify.
14786
14818
 
14787
14819
  FILE CREATION:
@@ -14798,7 +14830,16 @@ When you call \`required-permissions\` (see workflow step 6 for when), use SCOPE
14798
14830
  - Embedded scripts \u2192 "SCOPE.DC-APPS.MANAGE-EMBEDDED-SCRIPTS"
14799
14831
 
14800
14832
  CRITICAL: Only include permissions you have explicitly seen in the Wix SDK documentation (via MCP or loaded skills) \u2014 NEVER guess or infer a scope ID. If you cannot point to where you saw it, do NOT include it. When in doubt, skip the call entirely. A fabricated scope ID will show an error to the user and confuse them; a missing permission is just a warning the user can fix.
14801
- `;
14833
+
14834
+ The \`required-permissions\` tool records and surfaces permissions to the user automatically \u2014 NEVER mention permissions/scopes (IDs or names) in your output, or tell the user to grant them.`;
14835
+ function buildCodegenRules(environmentIdentity) {
14836
+ return [
14837
+ (0, shared_rules_1.buildEnvironmentRules)(environmentIdentity),
14838
+ shared_rules_1.BOUNDARY_RULES,
14839
+ CODEGEN_CORE_RULES,
14840
+ shared_rules_1.OUTPUT_MESSAGE_RULES
14841
+ ].join("\n\n");
14842
+ }
14802
14843
  }
14803
14844
  });
14804
14845
 
@@ -14807,8 +14848,9 @@ var require_ask_rules = __commonJS({
14807
14848
  "dist/opencode-integration/rules/ask-rules.js"(exports2) {
14808
14849
  "use strict";
14809
14850
  Object.defineProperty(exports2, "__esModule", { value: true });
14810
- exports2.ASK_RULES = void 0;
14811
- exports2.ASK_RULES = `CORE PRINCIPLES:
14851
+ exports2.buildAskRules = buildAskRules;
14852
+ var shared_rules_1 = require_shared_rules();
14853
+ var ASK_CORE_RULES = `CORE PRINCIPLES:
14812
14854
  - You are a READ-ONLY assistant. You MUST NOT modify, create, or delete any files.
14813
14855
  - Your job is to answer questions about the codebase and Wix platform by reading code and fetching documentation.
14814
14856
  - Use the read tool to explore the codebase and find relevant code.
@@ -14828,6 +14870,14 @@ DEBUGGING GUIDANCE:
14828
14870
  - Browser DevTools: the Console, Network, and Sources tabs.
14829
14871
  - \`console.log\` statements, then read the output in the already-running server logs.
14830
14872
  - Inspecting network requests in the browser, without starting a new server.`;
14873
+ function buildAskRules(environmentIdentity) {
14874
+ return [
14875
+ (0, shared_rules_1.buildEnvironmentRules)(environmentIdentity),
14876
+ shared_rules_1.BOUNDARY_RULES,
14877
+ ASK_CORE_RULES,
14878
+ shared_rules_1.OUTPUT_MESSAGE_RULES
14879
+ ].join("\n\n");
14880
+ }
14831
14881
  }
14832
14882
  });
14833
14883
 
@@ -14988,24 +15038,26 @@ var require_environments = __commonJS({
14988
15038
  var git_conflicts_rules_1 = require_git_conflicts_rules();
14989
15039
  var job_decision_manager_1 = require_job_decision_manager();
14990
15040
  var logger_12 = require_logger();
14991
- var SHARED_CODEGEN_RULE = {
14992
- filename: "codegen-instructions.md",
14993
- content: codegen_rules_1.CODEGEN_RULES
14994
- };
14995
- var SHARED_ASK_RULE = {
14996
- filename: "ask-instructions.md",
14997
- content: ask_rules_1.ASK_RULES
14998
- };
14999
15041
  var SHARED_GIT_CONFLICTS_RULE = {
15000
15042
  filename: "git-conflicts-instructions.md",
15001
15043
  content: git_conflicts_rules_1.GIT_CONFLICTS_RULES
15002
15044
  };
15003
- var withSharedRules = (env) => ({
15004
- ...env,
15005
- codegenRules: [SHARED_CODEGEN_RULE, ...env.codegenRules],
15006
- askRules: [SHARED_ASK_RULE, ...env.askRules],
15007
- gitConflictsRules: [SHARED_GIT_CONFLICTS_RULE, ...env.gitConflictsRules]
15008
- });
15045
+ var withSharedRules = (env) => {
15046
+ const sharedCodegenRule = {
15047
+ filename: "codegen-instructions.md",
15048
+ content: (0, codegen_rules_1.buildCodegenRules)(env.environmentIdentity)
15049
+ };
15050
+ const sharedAskRule = {
15051
+ filename: "ask-instructions.md",
15052
+ content: (0, ask_rules_1.buildAskRules)(env.environmentIdentity)
15053
+ };
15054
+ return {
15055
+ ...env,
15056
+ codegenRules: [sharedCodegenRule, ...env.codegenRules],
15057
+ askRules: [sharedAskRule, ...env.askRules],
15058
+ gitConflictsRules: [SHARED_GIT_CONFLICTS_RULE, ...env.gitConflictsRules]
15059
+ };
15060
+ };
15009
15061
  function getCodegenEnvironmentConfig() {
15010
15062
  switch (process.env.CODEGEN_ENVIRONMENT) {
15011
15063
  case types_1.Environment.STUDIO_2:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.405",
3
+ "version": "1.0.406",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -29,5 +29,5 @@
29
29
  "esbuild": "^0.27.2",
30
30
  "vitest": "^4.0.16"
31
31
  },
32
- "falconPackageHash": "7a15f5850d6a383ca1193b0a3473908455ef8cba130c912beb4ee409"
32
+ "falconPackageHash": "9524fe7789f8c47fddc924848695ccae0c7bf2bc332a8d29bfcdc0e5"
33
33
  }