@wix/ditto-codegen-public 1.0.491 → 1.0.493

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.
@@ -1,2 +1,3 @@
1
1
  COMMIT MESSAGE:
2
2
  First thing, before writing any code, call the `set-commit-message` tool. See its description for format and length.
3
+ Your code is saved to the site automatically when your run ends, with that message. You cannot see or check the save, so do not say you cannot confirm it.
package/dist/out.js CHANGED
@@ -12717,7 +12717,7 @@ var require_brik_import = __commonJS({
12717
12717
  exports2.BRIK_IMPORT_RULES = void 0;
12718
12718
  exports2.BRIK_IMPORT_RULES = `# Brik Tool Import Rules
12719
12719
 
12720
- If \`.wix/agentInput/brikMeta.json\` exists AND its \`brikMeta\` object has \`promptVariant\` set to \`skill-v1\`, this job is a Brik tool import: you MUST invoke the \`wix-brik\` skill FIRST and follow it exactly. It owns the import itself - scaffolding the Editor React Component, running the deterministic import script over \`.wix/agentInput/brikImport.json\`, splicing the tool's creative code, then installing dependencies and building plus generating the manifest. Do NOT derive the component's public surface yourself and do NOT re-tune the manifest.
12720
+ Check with \`glob\` whether \`.wix/agentInput/brikMeta.json\` exists. If it exists AND its \`brikMeta\` object has \`promptVariant\` set to \`skill-v1\`, this job is a Brik tool import: you MUST invoke the \`wix-brik\` skill FIRST and follow it exactly. It owns the import itself - scaffolding the Editor React Component, running the deterministic import script over \`.wix/agentInput/brikImport.json\`, splicing the tool's creative code, then installing dependencies and building plus generating the manifest. Do NOT derive the component's public surface yourself and do NOT re-tune the manifest.
12721
12721
 
12722
12722
  The skill does NOT replace step 5 of the workflow: its \`npx wix build\` transpiles without typechecking. Once its DONE WHEN checks pass, still run step 5 as the workflow says, and fix whatever it reports in your spliced code only - never in the script-written surface.
12723
12723
 
@@ -12843,7 +12843,7 @@ var require_user_attachments = __commonJS({
12843
12843
  exports2.USER_ATTACHMENTS_RULES = void 0;
12844
12844
  exports2.USER_ATTACHMENTS_RULES = `# User Attachment Rules
12845
12845
 
12846
- If \`.wix/agentInput/userAttachments.json\` exists, the user uploaded files with this request. Its \`userAttachments\` list gives each file's \`fileName\` (as the user named it), \`path\` (under \`.wix/agentInput/attachments/\`), \`mimeType\`, \`sizeBytes\` and \`status\`. Only files with \`status\` \`downloaded\` are on disk; any other status says why the file is missing, and you must not claim to have used it.
12846
+ Check with \`glob\` whether \`.wix/agentInput/userAttachments.json\` exists. If it does, the user uploaded files with this request. Its \`userAttachments\` list gives each file's \`fileName\` (as the user named it), \`path\` (under \`.wix/agentInput/attachments/\`), \`mimeType\`, \`sizeBytes\` and \`status\`. Only files with \`status\` \`downloaded\` are on disk; any other status says why the file is missing, and you must not claim to have used it.
12847
12847
 
12848
12848
  - Read the files the request refers to before you write any code. When the request doesn't say which, read them all.
12849
12849
  - When you build or change an Editor React Component from them, first read the \`wix-app\` skill's \`references/editor-react-component/USER-SOURCES.md\` in full, if the skill has it, and follow it: it says how to port the user's code, match a design and upload their images.
@@ -14568,7 +14568,7 @@ ${environmentIdentity}`;
14568
14568
  - \`multi-edit\` to apply N find-and-replace edits across one or more files in one call. NEVER call \`edit\` more than once per turn \u2014 use multi-edit instead. \`edit\` is reserved for a single edit to one file. When ${multiEditContextClause} across N files, use ONE \`multi-edit\` with all N edits.
14569
14569
  - \`apply_patch\` (when available): inside each \`*** Update File\` section, list hunks in FILE ORDER, top to bottom. The applier only searches forward from where the previous hunk matched, so a hunk whose lines sit ABOVE the previous one fails with "Failed to find expected lines" even though the lines exist \u2014 the whole patch is then rejected. Unsure of the order? Re-read the file first, or split into one patch per hunk.
14570
14570
  - Tool arguments are strict JSON, and \`write\`/\`edit\`/\`batch-write\`/\`multi-edit\`/\`apply_patch\` write \`content\`/\`oldString\`/\`newString\`/\`patchText\` to disk EXACTLY as decoded from that JSON \u2014 there is no second unescaping pass, so encode for the ONE decode that happens. Use \`\\n\`/\`\\t\`/\`\\"\` in the JSON when you want the file to contain a REAL newline/tab/quote character (a raw unescaped newline inside a JSON string value breaks parsing). If the file itself must contain the two LITERAL characters backslash-then-n (e.g. inside a string literal like \`.join('\\n')\`, a regex, or an already-escaped JSON value), escape the backslash itself in your JSON so it survives the one decode intact \u2014 do NOT emit a bare \`\\n\` expecting a tool to turn it back into two literal characters for you; none of them do.
14571
- - For tools where no batch variant exists (e.g. \`grep\`, \`glob\`), still emit MULTIPLE \`tool_use\` blocks in a SINGLE response when the calls are independent. Sequential turns waste a model round-trip per call.`;
14571
+ - For tools where no batch variant exists (e.g. \`grep\`, \`glob\`), still emit MULTIPLE \`tool_use\` blocks in a SINGLE response when the calls are independent. Sequential turns waste a model round-trip per call. If \`grep\` fails with "Ripgrep JSON record exceeded", a matching line is huge (a minified or generated file): do not repeat it, search that file with \`bash\` (\`grep -o -E '.{0,120}PATTERN.{0,120}' <file>\`) or read the part you need with \`read\` and an offset.`;
14572
14572
  }
14573
14573
  }
14574
14574
  });
@@ -14717,10 +14717,14 @@ ${validation.step}
14717
14717
  9. **Stop**: STOP immediately. Do NOT refactor, clean up, or verify.
14718
14718
 
14719
14719
  FILE CREATION:
14720
- - NEVER rewrite the same file twice. Once written, move on.
14720
+ - NEVER rewrite the same file twice. Once written, move on. Exception: see PORTING ATTACHED CODE.
14721
14721
  - Keep each file under 200 lines. Split into types.ts, utils.ts if needed.
14722
14722
  - Do NOT output comments in code unless they explain non-obvious logic.
14723
14723
 
14724
+ PORTING ATTACHED CODE:
14725
+ Only when \`.wix/agentInput/userAttachments.json\` exists and the request builds the code from the files it lists.
14726
+ - You may change a file you copied or wrote earlier in this run to turn the user's code into what the skill describes (e.g. move markup, content, colors and fonts out of a copied script into JSX, props and CSS). Use targeted \`edit\`/\`multi-edit\`/\`apply_patch\` hunks only: never \`write\`/\`batch-write\` the same path again, and don't read back files you wrote.
14727
+
14724
14728
  GENERATED FILES:
14725
14729
  - \`src/extensions/site/components/**/*.generated.ts\` is an auto-generated editor-react-component manifest \u2014 NEVER hand-edit. Change a manifest VALUE in the component's \`*.extension.ts\`; change anything else in the \`*.tsx\` / \`*.module.css\` / \`*.props.ts\` source. \`validate({ runBuild: true })\` regenerates the manifest when editor components exist. No other \`.generated.ts\` path is affected.
14726
14730
  - A write guard rejects \`write\`/\`edit\`/\`batch-write\`/\`multi-edit\`/\`apply_patch\` there, dropping the ENTIRE call \u2014 never batch that path with real edits (or put it in a patch alongside other hunks), or those are lost too and must be resubmitted.
@@ -15680,6 +15684,9 @@ var require_config = __commonJS({
15680
15684
  // harmless read.
15681
15685
  "/root/.config/opencode/rules/**": "allow",
15682
15686
  "/root/.opencode/**": "allow",
15687
+ // A failed `npm install` prints the path of its log here, and agents read it
15688
+ // to see why. Same auto-reject as above otherwise.
15689
+ "/root/.npm/_logs/**": "allow",
15683
15690
  "/tmp/**": "allow"
15684
15691
  };
15685
15692
  var PLANNING_TOOLS_DENIED = {
@@ -17799,6 +17806,7 @@ var require_executor = __commonJS({
17799
17806
  exports2.applyPostRunValidation = applyPostRunValidation;
17800
17807
  exports2.executeOpenCode = executeOpenCode;
17801
17808
  exports2.resolveFinalRunCost = resolveFinalRunCost;
17809
+ exports2.buildOpenCodeInvocation = buildOpenCodeInvocation;
17802
17810
  var child_process_1 = require("child_process");
17803
17811
  var ditto_codegen_types_12 = require_dist4();
17804
17812
  var config_12 = require_config();
@@ -17975,18 +17983,22 @@ var require_executor = __commonJS({
17975
17983
  });
17976
17984
  return { ...usage, cost: runCost };
17977
17985
  }
17978
- function buildArgs(prompt, continueSession) {
17986
+ var MAX_PROMPT_ARG_BYTES = 64 * 1024;
17987
+ function buildOpenCodeInvocation(prompt, continueSession) {
17979
17988
  const sessionArgs = continueSession ? ["--continue"] : [];
17980
- return [
17989
+ const args = [
17981
17990
  "run",
17982
17991
  ...sessionArgs,
17983
17992
  "--print-logs",
17984
17993
  "--log-level",
17985
17994
  "ERROR",
17986
17995
  "--format",
17987
- "json",
17988
- prompt
17996
+ "json"
17989
17997
  ];
17998
+ if (Buffer.byteLength(prompt) > MAX_PROMPT_ARG_BYTES) {
17999
+ return { args, stdinPrompt: prompt };
18000
+ }
18001
+ return { args: [...args, prompt] };
17990
18002
  }
17991
18003
  async function executeOpenCodeOnce(options, attempt, maxAttempts, toolUsage) {
17992
18004
  const { prompt, outputPath, projectId, onStdout, onStderr, continueSession = false } = options;
@@ -18024,7 +18036,7 @@ var require_executor = __commonJS({
18024
18036
  finalize
18025
18037
  };
18026
18038
  try {
18027
- const args = buildArgs(prompt, continueSession);
18039
+ const { args, stdinPrompt } = buildOpenCodeInvocation(prompt, continueSession);
18028
18040
  logger_12.logger.info("[OpenCode] Executing opencode run", {
18029
18041
  attempt,
18030
18042
  maxRetries: maxAttempts,
@@ -18041,9 +18053,14 @@ var require_executor = __commonJS({
18041
18053
  ctx.child = (0, child_process_1.spawn)("opencode", args, {
18042
18054
  cwd: outputPath,
18043
18055
  env,
18044
- stdio: ["ignore", "pipe", "pipe"],
18056
+ stdio: [stdinPrompt === void 0 ? "ignore" : "pipe", "pipe", "pipe"],
18045
18057
  detached: true
18046
18058
  });
18059
+ if (stdinPrompt !== void 0) {
18060
+ ctx.child.stdin?.on("error", () => {
18061
+ });
18062
+ ctx.child.stdin?.end(stdinPrompt);
18063
+ }
18047
18064
  timers.timeoutId = (0, process_handlers_1.setupTotalTimeout)(ctx);
18048
18065
  timers.idleCheckId = (0, process_handlers_1.setupIdleWatchdog)(ctx);
18049
18066
  (0, process_handlers_1.setupStdoutHandler)(ctx, onStdout);
@@ -23608,7 +23625,7 @@ var require_bi_events = __commonJS({
23608
23625
  var types_1 = require_types_impl();
23609
23626
  var bi_logger_1 = require_bi_logger2();
23610
23627
  var logger_12 = require_logger();
23611
- var MAX_JOB_INPUT_LENGTH = 3e4;
23628
+ var MAX_JOB_INPUT_LENGTH = 5e3;
23612
23629
  var TRUNCATION_SUFFIX = "\u2026";
23613
23630
  var JOB_STATUS_MAP = {
23614
23631
  COMPLETED: "successful",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.491",
3
+ "version": "1.0.493",
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": "391e252562c6169552e19a164b9aef3c38086e2e12244a9e99e091d6"
32
+ "falconPackageHash": "40f9c53bf13797af4a5fa48fc2599b1d7263aeec0289d6beab4e8089"
33
33
  }