@wix/ditto-codegen-public 1.0.462 → 1.0.464

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 +25 -6
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -11726,6 +11726,7 @@ var require_model_knobs = __commonJS({
11726
11726
  exports2.getSmallModel = getSmallModel;
11727
11727
  exports2.hasModelOverride = hasModelOverride;
11728
11728
  exports2.hasSmallModelOverride = hasSmallModelOverride;
11729
+ exports2.readEnumEnv = readEnumEnv;
11729
11730
  exports2.getReasoningEffort = getReasoningEffort;
11730
11731
  exports2.getSmallReasoningEffort = getSmallReasoningEffort;
11731
11732
  exports2.hasSmallReasoningEffortOverride = hasSmallReasoningEffortOverride;
@@ -11989,7 +11990,10 @@ skills already cover. Read-only.`;
11989
11990
  var MODEL_VARIANTS = {
11990
11991
  "openai/gpt-5.6-luna": ["xhigh", "high", "medium", "low"],
11991
11992
  "openai/gpt-5.6-sol": ["xhigh", "high", "medium", "low"],
11992
- "openai/gpt-5.6-terra": ["xhigh", "high", "medium", "low"]
11993
+ "openai/gpt-5.6-terra": ["xhigh", "high", "medium", "low"],
11994
+ "openai/gpt-6-astra": ["xhigh", "high", "medium", "low"],
11995
+ "openai/gpt-6-sol": ["xhigh", "high", "medium", "low"],
11996
+ "openai/gpt-6-luna": ["xhigh", "high", "medium", "low"]
11993
11997
  };
11994
11998
  function agentModel(model, opts = {}) {
11995
11999
  if (opts.variant && !MODEL_VARIANTS[model]?.includes(opts.variant)) {
@@ -15032,7 +15036,18 @@ var require_codegen_rules = __commonJS({
15032
15036
  Object.defineProperty(exports2, "__esModule", { value: true });
15033
15037
  exports2.buildCodegenRules = buildCodegenRules;
15034
15038
  var shared_rules_1 = require_shared_rules();
15035
- var CODEGEN_CORE_RULES = `CORE PRINCIPLES:
15039
+ var model_knobs_1 = require_model_knobs();
15040
+ var DELEGATED_VALIDATION = {
15041
+ toolRule: "- `validate` (tsc + build) is run by the `codegen-validator` subagent \u2014 do NOT call it directly; delegate via `task` at step 5.",
15042
+ taskListEntry: "`codegen-validator` (step 5; see step 5 for the exact prompt), ",
15043
+ step: `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. After the validator confirms a clean build, if you created or modified an EDITOR_REACT_COMPONENT extension in this task, run \`npx wix generate manifest\` via bash (the validator is instructed not to run it, so this is the only run).`
15044
+ };
15045
+ var DIRECT_VALIDATION = {
15046
+ toolRule: "- `validate` (tsc + build) \u2014 you call it yourself at step 5. Do NOT delegate it.",
15047
+ taskListEntry: "",
15048
+ step: `5. **Validate**: Call \`validate({ runBuild: true })\` yourself \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. Do NOT delegate this to a subagent, and do NOT make a separate tsc-only call first \u2014 the single runBuild pass already fails fast on type errors. Do NOT move on until the build is clean. After the build is clean, if you created or modified an EDITOR_REACT_COMPONENT extension in this task, run \`npx wix generate manifest\` via bash (idempotent).`
15049
+ };
15050
+ var buildCoreRules = (validation) => `CORE PRINCIPLES:
15036
15051
  - Do NOT invent or assume new types, modules, functions, props, events, or imports.
15037
15052
  - NEVER use mocks, placeholders, debugging, or TODOs in any code.
15038
15053
  - ALWAYS implement complete, production-ready functionality.
@@ -15044,8 +15059,8 @@ MINIMIZE TEXT OUTPUT \u2014 CRITICAL:
15044
15059
  - Every text token costs money. Use tools, not words.
15045
15060
 
15046
15061
  TOOL USAGE:
15047
- - \`validate\` (tsc + build) is run by the \`codegen-validator\` subagent \u2014 do NOT call it directly; delegate via \`task\` at step 5.
15048
- - \`task\` delegates to subagents: \`codegen-validator\` (step 5; see step 5 for the exact prompt), \`codegen-wix-docs\` (step 2; to SEARCH/discover an unknown Wix SDK method/shape/scope ID via wix-mcp), \`codegen-wds-docs\` (step 2; to discover WDS components/props you don't know). Docs subagents are for DISCOVERY only \u2014 give them a QUESTION ("which method lists X?"), never a known article URL to fetch.
15062
+ ${validation.toolRule}
15063
+ - \`task\` delegates to subagents: ${validation.taskListEntry}\`codegen-wix-docs\` (step 2; to SEARCH/discover an unknown Wix SDK method/shape/scope ID via wix-mcp), \`codegen-wds-docs\` (step 2; to discover WDS components/props you don't know). Docs subagents are for DISCOVERY only \u2014 give them a QUESTION ("which method lists X?"), never a known article URL to fetch.
15049
15064
  - Each \`task\` round-trip is EXPENSIVE (~90s of subagent startup, regardless of how small the question). So minimize them: ask ONE comprehensive question per API that returns everything you need at once \u2014 method name + FULL call signature + parameter shapes + required scope IDs. NEVER do a broad "find the X SDK" call and then a follow-up "what's the exact signature" call \u2014 that is two ~90s round-trips for one answer. Batch all your unknowns for a domain into a single delegation.
15050
15065
  - If BOTH docs subagents are needed, fire both \`task\` calls in ONE response (parallel), never serially.
15051
15066
  - \`uuid\` to generate UUIDs (supports count param for multiple). Do NOT use bash.
@@ -15064,7 +15079,7 @@ IMPLEMENTATION WORKFLOW:
15064
15079
  2. **Research**: Load the \`wix-app\` skill per extension type. SKIP this step entirely if the skill + KNOWN WIX APIS cover everything (common for dashboard + data-collection apps). Otherwise delegate ONLY to search for an API you genuinely can't identify \u2014 \`codegen-wix-docs\` (SDK), \`codegen-wds-docs\` (WDS), both in ONE response if both needed; pass each the question, not a known doc link \u2014 and wait for the summaries before building.
15065
15080
  3. **Build**: Write files incrementally \u2014 group by logical section, NOT all at once. For complex tasks (300+ total lines across files), split into multiple \`batch-write\` calls. NEVER hold back writing until all code is planned \u2014 write each logical piece as soon as it is ready. Build all extensions before registering.
15066
15081
  4. **Register**: Register all extensions in \`src/extensions.ts\`.
15067
- 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. After the validator confirms a clean build, if you created or modified an EDITOR_REACT_COMPONENT extension in this task, run \`npx wix generate manifest\` via bash (the validator is instructed not to run it, so this is the only run).
15082
+ ${validation.step}
15068
15083
  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.
15069
15084
  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.
15070
15085
  8. **Stop**: STOP immediately. Do NOT refactor, clean up, or verify.
@@ -15089,11 +15104,15 @@ When you call \`required-permissions\` (see workflow step 6 for when), use SCOPE
15089
15104
  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.
15090
15105
 
15091
15106
  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.`;
15107
+ function isValidatorSubagentSkipped() {
15108
+ return (0, model_knobs_1.readEnumEnv)("CODEGEN_RULES_NO_VALIDATOR", ["1"]) === "1";
15109
+ }
15092
15110
  function buildCodegenRules(environmentIdentity) {
15111
+ const validation = isValidatorSubagentSkipped() ? DIRECT_VALIDATION : DELEGATED_VALIDATION;
15093
15112
  return [
15094
15113
  (0, shared_rules_1.buildEnvironmentRules)(environmentIdentity),
15095
15114
  shared_rules_1.BOUNDARY_RULES,
15096
- CODEGEN_CORE_RULES,
15115
+ buildCoreRules(validation),
15097
15116
  shared_rules_1.OUTPUT_MESSAGE_RULES
15098
15117
  ].join("\n\n");
15099
15118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.462",
3
+ "version": "1.0.464",
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": "d0ead5d9d6a2d1c1d936e9fffcda2faef1bca6e18f0115a19388fc3b"
32
+ "falconPackageHash": "bc99223c321f92460c3a79ce23ea4c51a39980a6bd0d452d9461793d"
33
33
  }